Docker "No such image" (after prune mid-build) in CI
A docker run, docker tag, or docker save that references an image by id or tag fails with "No such image" when that image was deleted out from under it - most often by a concurrent docker system prune or docker image prune in another step on a shared daemon.
What this error means
A step fails with Error response from daemon: No such image: myorg/app:ci even though an earlier step built or pulled it. A prune ran in between.
Error response from daemon: No such image: myorg/app:ciCommon causes
A concurrent prune on a shared daemon
A cleanup job running docker system prune -a removed the image while another job still referenced it.
A prune step ordered before the consumer
A workflow that prunes before the step that needs the image deletes it prematurely.
How to fix it
Stop pruning shared images mid-pipeline
- Move prune to the very end of the pipeline, after all consumers.
- Avoid
-a(remove-all) prune while other jobs share the daemon.
# build/test first, prune last
docker build -t myorg/app:ci .
docker run --rm myorg/app:ci pytest
docker image prune -f --filter "until=1h"Isolate the daemon per job
- Use a dedicated dind daemon per job so prunes never affect other jobs.
services:
docker:
image: docker:27-dindHow to prevent it
- Order prune steps after all image consumers; scope with
--filter until=. - Give each job an isolated daemon when sharing causes cross-job deletes.