Skip to content
Latchkey

Docker "tag does not exist" - Fix Bad Tag References in CI

A docker tag or docker push referenced a local image that the daemon does not have. The source side of the tag operation is missing.

What this error means

docker tag or docker push fails with "No such image" or a tag-not-found error, naming the source image. Nothing was tagged because the source never existed locally under that name.

Terminal
Error response from daemon: No such image: api:latest
# the source image of the tag command does not exist locally

Common causes

The build produced a different image name/tag

You built with one tag (or none, leaving only an image ID) and then referenced a different name in docker tag/docker push. The names simply do not match.

Build and tag ran on different runners/jobs

In a split pipeline the image built in one job is not present on the runner doing the tag/push, because the local image store is not shared across jobs.

How to fix it

Tag the image at build time

Give the build the final tag directly so there is no separate lookup.

Terminal
docker build -t myorg/api:1.4.2 .
docker push myorg/api:1.4.2

List local images to confirm the source name

Check what the daemon actually holds before tagging.

Terminal
docker images
docker image inspect myorg/api:1.4.2 >/dev/null && echo present

How to prevent it

  • Build and push in the same job, or persist the image between jobs (load from an artifact or push then re-pull).
  • Use one canonical tag variable across build, tag, and push steps.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →