docker
Overview
Docker packages an application and its dependencies into containers. Start with the Docker basics guide for images, lifecycle, ports, networks, volumes, and debugging, then use the references below for a specific failure.
22 pages
-
docker build COPY failed — no such file or directory
Fix "COPY failed: no such file or directory" in docker build by checking .dockerignore, build context path, and COPY source paths.
-
cannot connect to the Docker daemon — how to fix
Fix "Cannot connect to the Docker daemon at unix:///var/run/docker.sock" by starting the Docker daemon or Desktop app.
-
docker compose environment variables — how to set
Set environment variables in docker compose using env_file, environment key, .env file substitution, and override files.
-
docker container exits immediately — how to fix
Fix a Docker container that exits immediately after docker run. Common causes include no foreground process, entrypoint crash, or a missing command.
-
docker get container IP address with docker inspect
Find a Docker container IP address from the host using docker inspect. Includes named networks, all container IPs, and why container names are usually better than IPs.
-
docker container name already in use — how to fix
Fix "container name is already in use" by removing the existing container or using --rm / a different name.
-
docker cp — copy files between container and host
Use docker cp to copy files or directories between a Docker container and the host, including "docker copy file from container" cases. Works with running or stopped containers.
-
Docker basics — images, containers, ports, volumes, and debugging
Understand Docker images, containers, ports, networks, and volumes. Includes a practical workflow for building, running, inspecting, and debugging containers.
-
docker pass environment variables — --env-file and -e
Pass environment variables to Docker containers using -e for single values or --env-file for a file of KEY=VALUE pairs.
-
docker exec — run a command inside a running container
Use docker exec to open a shell or run a command inside a running Docker container. Covers interactive shell, one-off commands, and running as a specific user.
-
docker HEALTHCHECK — add container health check
Add a HEALTHCHECK instruction to your Dockerfile so Docker reports whether a running container is healthy, unhealthy, or still starting.
-
docker image not found / repository does not exist — how to fix
Fix "Unable to find image" or "repository does not exist" in Docker by checking image name, tag, and registry login.
-
docker multi-stage build — reduce image size
Use Docker multi-stage builds to produce small production images by discarding build tools and dependencies in a separate builder stage.
-
docker network — connect containers to each other
Connect Docker containers on the same user-defined network so they can communicate by container name. Covers bridge networks and docker compose networking.
-
docker no space left on device — how to fix
Recover Docker disk space by inspecting usage and pruning unused images, stopped containers, networks, and build cache. Volumes require an explicit option.
-
docker permission denied socket /var/run/docker.sock — how to fix
Fix "docker permission denied socket" and "permission denied while trying to connect to the Docker daemon socket at /var/run/docker.sock" by adding your user to the docker group.
-
docker port already allocated — how to fix
Fix "Bind for 0.0.0.0:PORT failed: port is already allocated" in Docker by finding and stopping the process using that port.
-
docker image prune — remove unused images
Free disk space by removing dangling and unused Docker images with docker image prune. Includes safe vs aggressive cleanup options.
-
docker pull rate limit exceeded — how to fix
Fix Docker Hub pull rate limit exceeded by logging in, using a token in CI, and mirroring or caching frequently pulled images.
-
docker remove all stopped containers
Remove all stopped Docker containers with docker container prune or docker rm. Includes filtering by status and bulk removal.
-
docker logs — view container output
Use docker logs to view stdout/stderr output from a Docker container. Includes tail, follow, timestamps, and since options.
-
docker volume mount and bind mount — how to use
Mount volumes or bind directories into Docker containers using -v and --mount. Covers named volumes, bind mounts, and read-only mounts.