Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,18 @@ cleanall: clean
# ── Docker image (rebuild when the Dockerfile is newer than the stamp) ───────
# Previously this stamp depended on a FORCE target, which marked every
# ISO/ELF out of date on every `make`. Depend on the Dockerfile instead.
#
# The stamp only proves the image was built at some point in the past; it
# doesn't prove the image still exists in the local Docker daemon (e.g. after
# `docker system prune` or a fresh machine/context). Detect that case at
# parse time and drop the stale stamp so the image gets rebuilt.
ifneq ($(wildcard .docker-image),)
ifneq ($(shell command -v docker 2>/dev/null),)
ifeq ($(shell docker image inspect $(DOCKER_IMG) >/dev/null 2>&1 && echo yes),)
$(shell rm -f .docker-image)
endif
endif
endif

.docker-image: tools/Dockerfile
docker build --platform $(DOCKER_PLATFORM) --load -t $(DOCKER_IMG) -f tools/Dockerfile .
Expand Down
Loading