The 'No such image' error occurs when Docker cannot find a specified image in your local repository. This typically happens due to typos in image names or tags, attempting to use an image that hasn't been pulled, or referencing images that have been removed.
This error indicates that the Docker daemon cannot locate the requested image in your local image cache. When you run commands like `docker run`, `docker rmi`, `docker tag`, or other image operations, Docker first looks for the image locally. If the image doesn't exist locally, Docker will either try to pull it from a registry (for `docker run`) or fail immediately with this error (for `docker rmi`, `docker tag`, etc.). The error can occur in several contexts: 1. **Running a container** - You specified an image name/tag that doesn't exist locally and cannot be found in the registry 2. **Removing an image** - You're trying to delete an image that has already been removed or never existed 3. **Tagging an image** - You're referencing a source image that isn't available locally 4. **Docker Compose** - A service references an image that hasn't been built or pulled 5. **Docker Swarm** - Worker nodes cannot find an image that exists only on the manager node
First, check which images are actually present on your system:
# List all local images
docker images
# Search for a specific image pattern
docker images | grep myimage
# Show all images including intermediate layers
docker images -a
# List images with full image IDs
docker images --no-truncCompare the output with the exact image name and tag you're trying to use. Remember that tags are case-sensitive and must match exactly.
Double-check the spelling of both the image name and tag:
# Common mistakes
docker run ubunut:latest # Wrong! Should be ubuntu
docker rmi nginx:latets # Wrong! Should be latest
docker run python:3.9 # Correct
docker run python # Uses :latest tag implicitlyPay attention to:
- Spelling of the image name
- Tag version format (e.g., 3.9 vs 3.9.0)
- Case sensitivity (image names are typically lowercase)
- Namespace prefix for non-official images (username/image)
If the image isn't available locally, pull it from the registry:
# Pull the image explicitly
docker pull nginx:alpine
# Then run the container
docker run nginx:alpine
# Or let docker run pull it automatically
docker run nginx:alpine # Will pull if not found locallyNote: docker run will attempt to pull missing images automatically, but docker rmi, docker tag, and other commands require the image to exist locally first.
If you pulled a specific tag but are trying to reference latest:
# You pulled this
docker pull ubuntu:22.04
# But tried to run this - will fail!
docker run ubuntu:latest # 'latest' tag not pulled
# Fix: use the tag you actually pulled
docker run ubuntu:22.04The latest tag is not a magic alias - it's a specific tag that must be pulled separately. Always use explicit version tags for reproducibility.
If you use Docker contexts to connect to remote Docker hosts, you might be looking at the wrong daemon:
# Check current context
docker context show
# List all contexts
docker context ls
# Switch back to default local context
docker context use default
# Verify the daemon you're connected to
docker info | head -20Images on one Docker host won't be available on another unless pushed to a registry first.
For Docker Compose, ensure images are built or pulled before starting:
# Build images defined in docker-compose.yml
docker-compose build
# Pull images from registries
docker-compose pull
# Start with forced rebuild
docker-compose up --build
# Clear old references and rebuild
docker-compose down
docker-compose rm
docker-compose up --buildIf you renamed an image in your compose file, update all service references to use the new name.
For Docker Swarm, ensure worker nodes can access the image:
# Push image to a registry accessible by all nodes
docker push myregistry.com/myimage:tag
# Deploy with registry authentication passed to workers
docker stack deploy --with-registry-auth -c docker-compose.yml mystack
# Or use docker service with registry auth
docker service create --with-registry-auth myregistry.com/myimage:tagWorker nodes don't have access to images on the manager node's local storage - they must pull from a registry.
If image references became corrupted after a Docker upgrade, you may need to clean up:
# Prune unused images
docker image prune -a
# If you still see phantom images, restart Docker
sudo systemctl restart docker
# Nuclear option: reset Docker image storage (CAUTION: deletes all images)
# sudo rm -rf /var/lib/docker/image
# sudo systemctl restart dockerFor broken references showing in docker images but failing with docker rmi:
# Try removing by ID instead of name
docker rmi abc123def456
# Or delete the reference file manually (advanced)
# Check: /var/lib/docker/image/overlay2/imagedb/content/sha256/When image names cause issues, use the image ID directly:
# Find the image ID
docker images --no-trunc
# Remove by ID
docker rmi sha256:abc123...
# Tag by ID
docker tag sha256:abc123... myimage:newtag
# Save by ID (not container ID!)
docker save sha256:abc123... -o myimage.tarImportant: Don't confuse container IDs with image IDs. Use docker images for image IDs and docker ps -a for container IDs.
### Understanding Docker Image Storage
Docker stores images in layers. When you see "no such image," Docker couldn't find either:
1. The manifest file mapping the name:tag to a digest
2. The actual layer content
View the storage structure:
# Default overlay2 driver paths
ls /var/lib/docker/image/overlay2/imagedb/content/sha256/
ls /var/lib/docker/image/overlay2/repositories.json### Difference Between docker save and docker export
A common mistake is confusing save (for images) with export (for containers):
# Save an IMAGE to a tar file
docker save myimage:tag -o image.tar
docker load -i image.tar
# Export a CONTAINER filesystem to a tar file
docker export mycontainer -o container.tar
docker import container.tar newimage:tagUsing the wrong command or ID type causes "no such image" errors.
### Docker BuildKit Cache Images
With BuildKit, intermediate cache images may appear and disappear:
# List buildx builders
docker buildx ls
# Prune buildx cache
docker buildx prune### Debugging Image Resolution
Enable Docker debug mode to see how image names are resolved:
# Check daemon logs for resolution details
journalctl -u docker.service -f
# Or with debug enabled
DOCKER_CLI_DEBUG=1 docker pull myimage:tag### Multi-Platform Image Issues
Some "no such image" errors occur due to platform mismatches:
# Check available platforms
docker manifest inspect nginx:alpine
# Pull specific platform
docker pull --platform linux/amd64 nginx:alpine### Rate Limiting Masquerading as Missing Image
Docker Hub rate limits can sometimes cause confusing errors. Authenticated pulls have higher limits:
# Log in to Docker Hub
docker login
# Check rate limit status
TOKEN=$(curl -s "https://auth.docker.io/token?service=registry.docker.io&scope=repository:library/alpine:pull" | jq -r .token)
curl -sI -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/library/alpine/manifests/latest | grep ratelimitdockerfile parse error line 5: unknown instruction: RRUN
How to fix 'unknown instruction' Dockerfile parse error in Docker
Error response from daemon: manifest for nginx:nonexistent not found: manifest unknown: manifest unknown
How to fix 'manifest for image:tag not found' in Docker
Error response from daemon: invalid reference format: repository name must be lowercase
How to fix 'repository name must be lowercase' in Docker
Error response from daemon: Container is not running
How to fix 'Container is not running' when using docker exec
the input device is not a TTY
How to fix 'the input device is not a TTY' in Docker