docker
21 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: no foreground process, entrypoint crash, or missing command.
-
docker get container IP address
Get the IP address of a running Docker container using docker inspect, or find the gateway and container IPs on a network.
-
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. Works with running or stopped 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 monitors container health and restarts unhealthy containers automatically.
-
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
Fix "no space left on device" in Docker by pruning unused images, containers, volumes, and build cache with docker system prune.
-
docker permission denied /var/run/docker.sock — how to fix
Fix "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.