docker Errors

18 error patterns

docker3 fixes

Docker filesystem no space

Docker.*failed to create.*overlay|filesystem.*no space

  • Run docker system prune
  • Increase disk allocation for Docker
docker3 fixes

Docker exec into container failed

Docker.*OCI runtime.*exec failed|container.*cannot exec

  • Verify container is running
  • Check exec command exists in image
docker3 fixes

Docker build COPY file not found

Docker.*build.*COPY failed.*no such file

  • Check .dockerignore isn't excluding file
  • Verify path relative to build context
docker3 fixes

Docker network endpoint conflict

Docker.*network.*endpoint.*already has an interface

  • Disconnect container from network first
  • Use docker network prune
docker3 fixes

Docker multi-stage build target not found

Docker.*multi-stage.*target.*not found

  • Verify --target matches stage name
  • Check FROM ... AS name spelling
docker3 fixes

Docker layer not found in registry

Docker.*layer.*not found.*manifest

  • Re-push base image to registry
  • Use docker pull to refresh local cache
docker3 fixes

Docker Compose depends_on health check failing

Docker.*compose.*service.*depends_on.*unhealthy

  • Add healthcheck to dependency service
  • Use condition: service_healthy
docker3 fixes

Docker ENTRYPOINT executable not found

Docker.*ENTRYPOINT.*exec.*not found

  • Use full path to executable
  • Verify binary exists in image
docker3 fixes

Docker build ARG not defined

Docker.*ARG.*not defined.*build-arg

  • Declare ARG in Dockerfile before use
  • Pass --build-arg NAME=value
docker3 fixes

Docker secret mount permission denied

Docker.*secrets.*mount.*permission denied

  • Set uid/gid on secret mount
  • Run as correct user for secret access
docker3 fixes

Docker healthcheck failing during startup

Docker.*healthcheck.*starting.*interval.*container unhealthy

  • Increase --start-period duration
  • Use --start-interval for initial checks
docker3 fixes

Port already allocated

Bind for 0\.0\.0\.0:\d+ failed: port is already allocated

  • Stop the container or process using the port: `docker ps` then `docker stop <id>`
  • Find what's using the port: `netstat -tlnp | grep <port>` or `lsof -i :<port>`
docker3 fixes

Image not found / pull access denied

pull access denied.*repository does not exist or may require.*docker login

  • Check the image name and tag for typos — verify it exists on the registry
  • Run `docker login` to authenticate with the private registry
docker3 fixes

Docker daemon permission denied

permission denied while trying to connect to the Docker daemon socket

  • Add your user to the docker group: `sudo usermod -aG docker $USER` then re-login
  • Run with sudo: `sudo docker ...` (not recommended for production)
docker3 fixes

COPY failed — file not found in build context

COPY failed:.*not found|file not found in build context

  • Ensure the file path is relative to the build context (the directory passed to `docker build`)
  • Check .dockerignore isn't excluding the file you're trying to COPY
docker3 fixes

Multi-stage COPY --from failed

COPY --from=.+.*not found|invalid from flag value

  • Ensure the stage name matches: `FROM node:18 AS builder` then `COPY --from=builder`
  • Check the source path exists in the builder stage after its RUN commands complete
docker3 fixes

Docker network / connection issues

dial tcp.*connect: connection refused|Could not resolve host|network .+ not found

  • Use service names (not localhost) for inter-container communication in docker-compose
  • Ensure containers are on the same Docker network: `docker network connect <network> <container>`
docker3 fixes

Volume mount denied / path error

Error response from daemon.*Mounts denied|error while creating mount source path

  • On Docker Desktop, add the path to Settings → Resources → File Sharing
  • Use absolute paths for volume mounts: `-v /full/path:/container/path`