Skip to content

Fix build failure from stale .docker-image stamp - #1

Open
jordanhubbard wants to merge 1 commit into
mainfrom
fix/docker-image-stale-stamp
Open

Fix build failure from stale .docker-image stamp#1
jordanhubbard wants to merge 1 commit into
mainfrom
fix/docker-image-stale-stamp

Conversation

@jordanhubbard

Copy link
Copy Markdown
Owner

Summary

  • make build was failing with pull access denied for pythonos-builder because the .docker-image stamp file only tracked tools/Dockerfile's mtime, not whether the pythonos-builder image still existed in the local Docker daemon.
  • After the image was pruned/removed (e.g. via docker system prune), the stale stamp caused make to skip the docker build step and go straight to docker run, which failed since the image was gone.
  • Fix: at parse time, detect that the stamp exists but the image doesn't (via docker image inspect), and delete the stale stamp so it gets rebuilt. Guarded with a command -v docker check because the same GNUmakefile is re-parsed inside the build container itself (no docker-in-docker there) — without the guard this check misfired inside the container and deleted the stamp mid-build.

Test plan

  • Verified original failure: docker rmi pythonos-builder, ran make build → reproduced pull access denied error.
  • Applied fix, ran make build from a clean state (no image, no stamp) → succeeded end-to-end, produced build-arm64/pythonos-arm64.elf.
  • Verified normal up-to-date rebuild (stamp present, image present) still completes without re-invoking docker build (~28s, no unnecessary rebuild).

The .docker-image stamp only tracked tools/Dockerfile's mtime, not
whether the pythonos-builder image still existed in the local Docker
daemon. After the image was pruned/removed, the stale stamp made make
skip rebuilding it and go straight to `docker run`, which failed with
"pull access denied" since the image was gone.

Detect the missing-image case at parse time and drop the stale stamp
so it gets rebuilt. Guarded with a `docker` availability check since
the same GNUmakefile is re-parsed inside the build container (no
docker-in-docker there), where the check would otherwise misfire and
delete the stamp mid-build.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant