Skip to content
Latchkey

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.

docker
Error response from daemon: No such image: myorg/app:ci

Common 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

  1. Move prune to the very end of the pipeline, after all consumers.
  2. Avoid -a (remove-all) prune while other jobs share the daemon.
Terminal
# 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

  1. Use a dedicated dind daemon per job so prunes never affect other jobs.
service config
services:
  docker:
    image: docker:27-dind

How 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.

Frequently asked questions

What causes ""No such image""?
A cleanup job running docker system prune -a removed the image while another job still referenced it.
How do I fix "No such image"?
Stop pruning shared images mid-pipeline

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card