Troubleshooting
Realistic Docker symptoms with exact error text, diagnosis commands and fixes
Daemon, install and permissions
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q1 Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Beginner
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?Likely causes โ dockerd is stopped, crashed, not installed, or DOCKER_HOST/context points elsewhere.
Diagnose โ
systemctl status docker
journalctl -u docker --no-pager -n 50
echo $DOCKER_HOST; docker context lsFix โ sudo systemctl enable --now docker. Unset a stale DOCKER_HOST or docker context use default. On Docker Desktop start the app.
Prevent โ Enable the service at boot and monitor it.
Q2 permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock
Beginner
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sockLikely causes โ User isn't in the docker group (socket is root:docker 0660) or group membership not refreshed.
Diagnose โ
ls -l /var/run/docker.sock
id -nGFix โ sudo usermod -aG docker $USER then newgrp docker or re-login. Do not chmod 666 the socket.
Prevent โ Remember the group is root-equivalent; prefer rootless for developers.
Q3 dockerd fails to start after editing daemon.json: unable to configure the Docker daemon with file /etc/docker/daemon.json
Intermediate
daemon.json: unable to configure the Docker daemon with file /etc/docker/daemon.jsonLikely causes โ Invalid JSON, unknown key, or a conflict with a flag in the systemd unit (the following directives are specified both as a flag and in the configuration file: hosts).
Diagnose โ
dockerd --validate --config-file /etc/docker/daemon.json
jq . /etc/docker/daemon.json
journalctl -xeu dockerFix โ Correct JSON; for the hosts conflict create a systemd drop-in that clears ExecStart flags: ExecStart= then ExecStart=/usr/bin/dockerd.
Prevent โ Validate config in CI before rollout.
Q4 docker: command not found right after installing Docker Desktop on macOS.
Beginner
docker: command not found right after installing Docker Desktop on macOS.Likely causes โ Desktop not started, CLI symlinks not created, or PATH missing /usr/local/bin.
Diagnose โ ls -l /usr/local/bin/docker, which docker, check Desktop settings for "Install CLI tools".
Fix โ Start Docker Desktop, accept system privileges to create symlinks, or add ~/.docker/bin to PATH.
Prevent โ Standardise installs via MDM.
Q5 docker info shows WARNING: bridge-nf-call-iptables is disabled
Intermediate
docker info shows WARNING: bridge-nf-call-iptables is disabledLikely causes โ br_netfilter module not loaded or sysctl off.
Diagnose โ lsmod | grep br_netfilter; sysctl net.bridge.bridge-nf-call-iptables
Fix โ
sudo modprobe br_netfilter
echo br_netfilter | sudo tee /etc/modules-load.d/br_netfilter.conf
echo 'net.bridge.bridge-nf-call-iptables=1' | sudo tee /etc/sysctl.d/99-docker.conf
sudo sysctl --systemPrevent โ Bake into the host image.
Q6 Docker service flaps with failed to start daemon: Error initializing network controller: ... iptables failed
Intermediate
failed to start daemon: Error initializing network controller: ... iptables failedLikely causes โ iptables binary/alternatives mismatch (nft vs legacy), a firewall tool flushing chains, or missing kernel modules.
Diagnose โ
iptables --version
update-alternatives --display iptables
journalctl -u docker | grep -i iptablesFix โ Align iptables backend (update-alternatives --set iptables /usr/sbin/iptables-legacy on older Docker, or use nft consistently on newer), reload modules, restart docker after firewalld.
Prevent โ Restart Docker after firewall reloads; use DOCKER-USER for rules.
Q7 docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io: no such host
Intermediate
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io: no such hostLikely causes โ DNS failure on the host, proxy needed, or offline.
Diagnose โ
getent hosts registry-1.docker.io
resolvectl status
curl -I https://registry-1.docker.io/v2/Fix โ Repair host DNS, or configure the daemon proxy via systemd drop-in (HTTPS_PROXY), then systemctl daemon-reload && systemctl restart docker.
Prevent โ Use an internal mirror.
Q8 After upgrade: Error response from daemon: client version 1.43 is too new. Maximum supported API version is 1.41
Intermediate
Error response from daemon: client version 1.43 is too new. Maximum supported API version is 1.41Likely causes โ CLI newer than a remote daemon.
Diagnose โ docker version
Fix โ Upgrade the daemon, or temporarily export DOCKER_API_VERSION=1.41.
Prevent โ Keep CLI and engine versions aligned across hosts.
Q9 Failed to start docker.service: Unit docker.service is masked.
Beginner
Failed to start docker.service: Unit docker.service is masked.Likely causes โ Service was masked (manually or by a package/Snap change).
Diagnose โ systemctl status docker; systemctl is-enabled docker docker.socket
Fix โ sudo systemctl unmask docker docker.socket && sudo systemctl enable --now docker.
Prevent โ Avoid mixing Snap and apt Docker installs.
Q10 docker works with sudo but not in a systemd service running as a different user.
Intermediate
docker works with sudo but not in a systemd service running as a different user.Likely causes โ Service user not in the docker group; supplementary groups not applied, or ProtectHome/sandboxing blocks the socket.
Diagnose โ systemctl show svc -p User -p SupplementaryGroups; sudo -u svcuser docker ps.
Fix โ Add SupplementaryGroups=docker to the unit, restart it.
Prevent โ Use rootless Docker for service users where practical.
Q11 Docker Desktop on Windows: Docker Desktop - WSL kernel version too low or WSL 2 not starting.
Intermediate
Docker Desktop - WSL kernel version too low or WSL 2 not starting.Likely causes โ Outdated WSL kernel, virtualization disabled in BIOS, or Hyper-V/VirtualMachinePlatform features off.
Diagnose โ wsl --status, wsl --version, Task Manager shows virtualization state.
Fix โ wsl --update, enable "Virtual Machine Platform" and "Windows Subsystem for Linux", enable virtualization in BIOS, reboot.
Prevent โ Keep WSL updated with Windows updates.
Q12 docker: Got permission denied when running docker compose in CI under a non-root runner.
Beginner
docker: Got permission denied when running docker compose in CI under a non-root runner.Likely causes โ Runner user lacks socket access.
Diagnose โ id, ls -l /var/run/docker.sock.
Fix โ Add the runner user to docker group and restart the runner service (groups load at login/start).
Prevent โ Use ephemeral runners with a configured image.
Q13 Docker daemon takes 5+ minutes to start with many containers.
Advanced
Likely causes โ Huge number of containers/images/log files, slow disk, live-restore off with many containers to restore, corrupted metadata.
Diagnose โ
journalctl -u docker | grep -E 'Loading containers|Restoring'
docker system df
ls /var/lib/docker/containers | wc -lFix โ Remove dead containers, prune, move to faster disk, enable live-restore.
Prevent โ Garbage-collect regularly and cap container churn.
Q14 docker ps hangs forever.
Advanced
docker ps hangs forever.Likely causes โ dockerd or containerd deadlocked, a stuck container/shim, or exhausted resources (PIDs, FDs, disk).
Diagnose โ
timeout 10 docker version
systemctl status containerd docker
kill -SIGUSR1 $(pidof dockerd); journalctl -u docker | tail # goroutine dump
df -h; ps aux | grep -c defunctFix โ Restart containerd then docker; kill the stuck shim; reboot if kernel is wedged (D-state processes).
Prevent โ Alert on daemon latency and node pressure.
Q15 Error response from daemon: driver failed programming external connectivity on endpoint ... iptables: No chain/target/match by that name
Intermediate
Error response from daemon: driver failed programming external connectivity on endpoint ... iptables: No chain/target/match by that nameLikely causes โ The DOCKER iptables chain was flushed (firewalld/ufw reload, iptables -F).
Diagnose โ iptables -t nat -L DOCKER -n (chain missing).
Fix โ sudo systemctl restart docker to recreate chains.
Prevent โ Do not flush iptables on Docker hosts; reload firewalld then restart Docker, or put custom rules in DOCKER-USER.
Q16 docker-compose: command not found but docker compose is expected.
Beginner
docker-compose: command not found but docker compose is expected.Likely causes โ Compose v1 (docker-compose) is removed; v2 is a CLI plugin invoked as docker compose.
Diagnose โ docker compose version; ls /usr/libexec/docker/cli-plugins.
Fix โ Install docker-compose-plugin package. For legacy scripts add a shim docker-compose that execs docker compose.
Prevent โ Update scripts to the v2 syntax.
Q17 docker compose up fails: unknown shorthand flag: 'd' in -d or docker: 'compose' is not a docker command.
Beginner
docker compose up fails: unknown shorthand flag: 'd' in -d or docker: 'compose' is not a docker command.Likely causes โ Compose plugin missing from this installation (e.g., distro docker.io package).
Diagnose โ docker --help | grep compose; dpkg -l | grep compose.
Fix โ Install docker-compose-plugin from Docker's repo, or the docker-compose-v2 package on Ubuntu.
Prevent โ Install from the official Docker apt/yum repo.
Q18 Error response from daemon: OCI runtime create failed: runc create failed: unable to start container process: ... permission denied
Advanced
Error response from daemon: OCI runtime create failed: runc create failed: unable to start container process: ... permission deniedLikely causes โ Entrypoint file not executable, AppArmor/SELinux denial, noexec mount on the path, or a wrong USER lacking access.
Diagnose โ
docker run --rm --entrypoint ls image -l /entrypoint.sh
dmesg | grep -i -E 'apparmor|denied'
mount | grep noexecFix โ chmod +x (or COPY --chmod=0755), use a path not on a noexec mount, fix the MAC policy/labels.
Prevent โ Test images in an environment matching production security settings.
Q19 docker version shows server Docker Desktop but a script expects Linux engine features such as host networking.
Advanced
docker version shows server Docker Desktop but a script expects Linux engine features such as host networking.Likely causes โ Docker Desktop runs the engine in a VM; host networking and bind mount paths refer to the VM, not the laptop.
Diagnose โ docker info | grep -E 'Operating System|Context'; docker context ls.
Fix โ Enable "host networking" in Desktop settings (supported on recent versions) or publish ports; use host.docker.internal.
Prevent โ Document Desktop vs Linux differences and test in CI on Linux.
Q20 Error: failed to solve: failed to read dockerfile: open Dockerfile: no such file or directory
Beginner
Error: failed to solve: failed to read dockerfile: open Dockerfile: no such file or directoryLikely causes โ Wrong context path or -f path, filename case, or .dockerignore excluding the Dockerfile.
Diagnose โ ls -la; docker build -f path/Dockerfile path/.
Fix โ Pass correct context and -f; the last arg is the context, not the Dockerfile.
Prevent โ Use docker buildx bake or Compose build.context/dockerfile fields.
Q21 After reboot, containers don't come back though --restart always was set.
Intermediate
--restart always was set.Likely causes โ docker service not enabled at boot, containers were created before the policy was set, or they were stopped manually with unless-stopped.
Diagnose โ
systemctl is-enabled docker
docker inspect -f '{{.HostConfig.RestartPolicy}}' c
journalctl -u docker -b | grep -i restartFix โ systemctl enable docker; docker update --restart unless-stopped c.
Prevent โ Define policies in Compose files and test a reboot.
Q22 Error response from daemon: Conflict. The container name "/web" is already in use by container ...
Beginner
Error response from daemon: Conflict. The container name "/web" is already in use by container ...Likely causes โ An old (possibly stopped) container has that name.
Diagnose โ docker ps -a --filter name=web
Fix โ docker rm -f web or choose another name; use --rm for ephemeral containers.
Prevent โ Let Compose name containers or use --rm.
Q23 docker login prints Error saving credentials: error storing credentials - err: exit status 1, out: ... The name org.freedesktop.secrets was not provided
Intermediate
docker login prints Error saving credentials: error storing credentials - err: exit status 1, out: ... The name org.freedesktop.secrets was not providedLikely causes โ credsStore set to secretservice or desktop in ~/.docker/config.json but no keyring/secret service is running (headless server).
Diagnose โ cat ~/.docker/config.json
Fix โ Install and use pass with docker-credential-pass, or remove credsStore to store base64 creds (less secure), or use a credential helper for your cloud (ecr-login).
Prevent โ Use short-lived tokens/OIDC in CI.
Q24 docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: ... cgroup
Advanced
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: ... cgroupLikely causes โ cgroup driver mismatch (cgroupfs vs systemd), cgroup v2 not delegated, or rootless without delegation.
Diagnose โ
docker info | grep -i 'cgroup'
cat /sys/fs/cgroup/cgroup.controllers
journalctl -u containerd | tailFix โ Align on systemd cgroup driver ("exec-opts": ["native.cgroupdriver=systemd"]), enable delegation for rootless (/etc/systemd/system/[email protected]/delegate.conf).
Prevent โ Use consistent runtime configuration across Kubernetes/Docker nodes.
Q25 docker context use remote then Cannot connect to the Docker daemon at ssh://...
Intermediate
docker context use remote then Cannot connect to the Docker daemon at ssh://...Likely causes โ SSH key/host-key problems, remote user lacks docker access, or docker binary absent on the remote PATH for non-interactive shells.
Diagnose โ
ssh user@host docker ps
docker --context remote info
ssh -v user@host trueFix โ Add the key to ssh-agent, add the user to docker group, ensure PATH includes docker in ~/.bashrc (non-interactive part).
Prevent โ Use ControlMaster in ssh config for speed and reliability.
Build failures and cache problems
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q26 failed to solve: process "/bin/sh -c apt-get install -y curl" did not complete successfully: exit code: 100 with E: Unable to locate package curl
Beginner
failed to solve: process "/bin/sh -c apt-get install -y curl" did not complete successfully: exit code: 100 with E: Unable to locate package curlLikely causes โ Package index missing because apt-get update is in a separate cached layer or was never run (images ship without lists).
Diagnose โ Re-run with docker build --progress=plain --no-cache ..
Fix โ RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*.
Prevent โ Always chain update and install.
Q27 E: Failed to fetch http://deb.debian.org/... 404 Not Found during build of an old image.
Intermediate
E: Failed to fetch http://deb.debian.org/... 404 Not Found during build of an old image.Likely causes โ Base release is EOL and moved to archive (e.g., Debian buster, Ubuntu EOL), or a stale cached layer.
Diagnose โ cat /etc/os-release in the image; check the release EOL date.
Fix โ Upgrade base (bookworm), or point sources to archive.debian.org as a stopgap.
Prevent โ Track base EOL dates; use Renovate.
Q28 COPY failed: file not found in build context or excluded by .dockerignore: stat app.jar: file does not exist
Beginner
COPY failed: file not found in build context or excluded by .dockerignore: stat app.jar: file does not existLikely causes โ File not built yet, path relative to wrong context, or .dockerignore excludes it (*.jar, target).
Diagnose โ
cat .dockerignore
docker build --progress=plain .
ls target/Fix โ Build artifact first or use multi-stage, fix path, add !target/app.jar exception.
Prevent โ Use multi-stage builds so artifacts come from a prior stage.
Q29 ERROR: failed to solve: failed to compute cache key: "/requirements.txt" not found: not found
Beginner
ERROR: failed to solve: failed to compute cache key: "/requirements.txt" not found: not foundLikely causes โ The file isn't in the context root, a .dockerignore pattern, or building from the wrong directory.
Diagnose โ docker build -f services/api/Dockerfile services/api vs .
Fix โ Align the context with the COPY paths.
Prevent โ Document the build context in the Makefile or Compose file.
Q30 Build hangs at RUN pip install ... or npm install and eventually times out.
Intermediate
RUN pip install ... or npm install and eventually times out.Likely causes โ No network from build (proxy, DNS), MTU mismatch on VPN or cloud overlay, or registry outage.
Diagnose โ
docker run --rm busybox wget -qO- https://pypi.org/simple/ | head
docker run --rm busybox ping -c1 8.8.8.8
ip link show docker0 | grep mtuFix โ Set proxies; lower MTU in daemon.json ("mtu": 1400); set DNS servers.
Prevent โ Use an internal package mirror.
Q31 failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error on line 12: unknown instruction: RUNN
Beginner
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error on line 12: unknown instruction: RUNNLikely causes โ Typo, or a missing line continuation backslash making the next line an instruction.
Diagnose โ Check the stated line; hadolint Dockerfile.
Fix โ Correct the instruction; ensure \ at end of continued lines with no trailing spaces after it.
Prevent โ Lint in CI and use an editor with Dockerfile support.
Q32 Build works locally but fails in CI with exec format error in a RUN step.
Intermediate
exec format error in a RUN step.Likely causes โ Architecture mismatch (arm64 base layers on amd64 runner or vice versa), or QEMU binfmt not registered for cross-platform builds.
Diagnose โ
docker image inspect base --format '{{.Architecture}}'
uname -m
docker buildx lsFix โ Specify --platform, install QEMU: docker run --privileged --rm tonistiigi/binfmt --install all.
Prevent โ Build multi-arch explicitly and test on both arches.
Q33 Layer cache is never used though nothing changed (every step rebuilds).
Advanced
Likely causes โ Fresh CI runner, --no-cache, ARG with changing value (e.g. BUILD_DATE) declared early, COPY . . including changing files, or builder pruned.
Diagnose โ docker buildx build --progress=plain .; diff docker history of two builds.
Fix โ Move volatile ARGs to the end, ignore generated files, add registry cache.
Prevent โ Treat cache hit rate as a metric.
Q34 ERROR: failed to solve: failed to fetch anonymous token: ... 429 Too Many Requests
Intermediate
ERROR: failed to solve: failed to fetch anonymous token: ... 429 Too Many RequestsLikely causes โ Docker Hub rate limit on anonymous pulls of base images.
Diagnose โ curl -s -I -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest and read ratelimit-remaining.
Fix โ docker login, use mirror/pull-through cache, switch to registry mirror images.
Prevent โ Mirror base images internally.
Q35 failed to solve: failed to read expected number of bytes: unexpected EOF or no space left on device during build.
Advanced
failed to solve: failed to read expected number of bytes: unexpected EOF or no space left on device during build.Likely causes โ Disk full on the builder, huge build context, or a flaky network.
Diagnose โ
df -h /var/lib/docker
docker buildx du
docker system dfFix โ docker builder prune -af --keep-storage 20GB, docker image prune -a, enlarge disk.
Prevent โ Set BuildKit GC limits and monitor disk.
Q36 ARG value is empty during RUN: echo $VERSION prints nothing.
Intermediate
ARG value is empty during RUN: echo $VERSION prints nothing.Likely causes โ ARG declared before FROM (out of stage scope), declared in a previous stage, or not passed with --build-arg.
Diagnose โ Read the Dockerfile; run with --progress=plain.
Fix โ Redeclare ARG VERSION after FROM in the stage that needs it; pass --build-arg VERSION=1.2.
Prevent โ Keep ARG declarations next to usage.
Q37 unable to prepare context: path "." not found or build context transfer is 3 GB and takes forever.
Beginner
unable to prepare context: path "." not found or build context transfer is 3 GB and takes forever.Likely causes โ Context includes node_modules, .git, datasets, or you ran the build in the home directory.
Diagnose โ du -sh * | sort -h | tail; BuildKit prints transferring context: 3.1GB.
Fix โ Build from the project directory, add .dockerignore.
Prevent โ Allow-list style ignore: * then !src.
Q38 Multi-stage build error: COPY --from=builder /app/dist ...: not found
Intermediate
COPY --from=builder /app/dist ...: not foundLikely causes โ Wrong path in builder, build step silently output elsewhere, stage name typo, or different WORKDIR.
Diagnose โ
docker build --target builder -t dbg .
docker run --rm dbg find / -name dist -maxdepth 4Fix โ Correct the path or WORKDIR; fail the build if artifacts are missing (RUN test -f /app/dist/index.js).
Prevent โ Add artifact checks after build steps.
Q39 The command '/bin/sh -c ./gradlew build' returned a non-zero code: 126
Intermediate
The command '/bin/sh -c ./gradlew build' returned a non-zero code: 126Likely causes โ Script lacks execute bit (common when copied from Windows), or CRLF line endings (/bin/sh^M: bad interpreter).
Diagnose โ ls -l gradlew; file gradlew; head -1 gradlew | od -c.
Fix โ chmod +x gradlew (or COPY --chmod=755), dos2unix, set .gitattributes * text=auto eol=lf for shell scripts.
Prevent โ .gitattributes for *.sh text eol=lf.
Q40 standard_init_linux.go: exec user process caused: no such file or directory for an existing binary.
Advanced
standard_init_linux.go: exec user process caused: no such file or directory for an existing binary.Likely causes โ Missing dynamic loader or interpreter: glibc binary on Alpine/scratch, or shebang #!/bin/bash where bash does not exist, or CRLF in shebang.
Diagnose โ
file app; ldd app
docker run --rm --entrypoint sh image -c 'head -1 /entrypoint.sh'Fix โ Build statically (CGO_ENABLED=0), use a matching base (distroless base/cc), install bash or use #!/bin/sh.
Prevent โ Test the final image, not just the build stage.
Q41 Build secret mount fails: failed to solve: secret "npmrc" not found
Intermediate
failed to solve: secret "npmrc" not foundLikely causes โ --secret id=npmrc,src=... not passed, ID mismatch, or running with legacy builder.
Diagnose โ Compare id= in the Dockerfile and CLI; check DOCKER_BUILDKIT.
Fix โ docker build --secret id=npmrc,src=$HOME/.npmrc .; in Compose define build.secrets.
Prevent โ Add a header # syntax=docker/dockerfile:1 and use BuildKit everywhere.
Q42 docker build succeeds, but the image runs old code.
Intermediate
docker build succeeds, but the image runs old code.Likely causes โ The container was not recreated, a different tag is running, cache reused a stale COPY layer (rare), or Compose image: pulls an older tag.
Diagnose โ
docker images --digests app
docker inspect -f '{{.Image}}' running_containerFix โ docker compose up -d --build --force-recreate; tag explicitly.
Prevent โ Deploy by digest/immutable tags.
Q43 ERROR: failed to solve: dockerfile.v0: failed to resolve source metadata for docker.io/library/node:22-alpine: ... x509: certificate signed by unknown authority
Intermediate
ERROR: failed to solve: dockerfile.v0: failed to resolve source metadata for docker.io/library/node:22-alpine: ... x509: certificate signed by unknown authorityLikely causes โ Corporate TLS inspection proxy; the CA isn't trusted by the daemon/BuildKit.
Diagnose โ openssl s_client -connect registry-1.docker.io:443 -showcerts
Fix โ Install the corporate CA into the host trust store (update-ca-certificates) and restart docker; for docker-container buildx driver pass --config buildkitd.toml with CA; inside images add CA for RUN downloads.
Prevent โ Distribute CA through config management.
Q44 buildx error: ERROR: multiple platforms feature is currently not supported for docker driver
Intermediate
buildx error: ERROR: multiple platforms feature is currently not supported for docker driverLikely causes โ Default docker driver without containerd image store cannot build multi-platform images.
Diagnose โ docker buildx ls
Fix โ docker buildx create --use --driver docker-container, or enable the containerd image store in Docker Desktop/Engine settings.
Prevent โ CI uses a dedicated builder.
Q45 --load with multiple platforms fails: docker exporter does not currently support exporting manifest lists
Intermediate
--load with multiple platforms fails: docker exporter does not currently support exporting manifest listsLikely causes โ Local classic image store can hold only one platform.
Diagnose โ docker buildx build --platform linux/amd64,linux/arm64 --load . triggers the error.
Fix โ Use --push, or --output type=oci,dest=app.tar, or build one platform with --load; or enable containerd image store.
Prevent โ Test per-platform locally, push multi-arch in CI.
Q46 npm ERR! code ELIFECYCLE building native modules on Alpine (gyp ERR! find Python).
Intermediate
npm ERR! code ELIFECYCLE building native modules on Alpine (gyp ERR! find Python).Likely causes โ Alpine lacks python3, make, g++ needed by node-gyp.
Diagnose โ Read the full npm log with --progress=plain.
Fix โ apk add --no-cache python3 make g++ in the build stage only, or switch to node:22-slim.
Prevent โ Do native compiles in a builder stage, copy artifacts.
Q47 HEALTHCHECK is missing from an image built with Podman/Buildah.
Intermediate
HEALTHCHECK is missing from an image built with Podman/Buildah.Likely causes โ Buildah defaults to OCI format which does not support HEALTHCHECK.
Diagnose โ podman inspect image | jq '.[0].Config.Healthcheck'
Fix โ podman build --format docker . or define the check at runtime.
Prevent โ Standardise on --format docker where health checks matter.
Q48 Dockerfile RUN --mount=type=cache is ignored/errors: the --mount option requires BuildKit
Beginner
RUN --mount=type=cache is ignored/errors: the --mount option requires BuildKitLikely causes โ Legacy builder in use (old Docker, DOCKER_BUILDKIT=0).
Diagnose โ docker version; echo $DOCKER_BUILDKIT.
Fix โ Upgrade to Docker 23+ (BuildKit default) or DOCKER_BUILDKIT=1; add the # syntax= line.
Prevent โ Pin builder tooling in CI.
Q49 Error: buildx failed with: ERROR: failed to solve: failed to push registry/app:tag: unexpected status: 401 Unauthorized
Beginner
Error: buildx failed with: ERROR: failed to solve: failed to push registry/app:tag: unexpected status: 401 UnauthorizedLikely causes โ Not logged in as the user running the build (credentials come from the client's ~/.docker/config.json), token lacks push scope, or the repository does not exist.
Diagnose โ docker login reg; cat ~/.docker/config.json; check token scopes.
Fix โ Log in before building, grant write permission, create the repository (ECR).
Prevent โ Use OIDC with least-privilege push roles.
Q50 --cache-from type=gha shows no cache hits in GitHub Actions.
Advanced
--cache-from type=gha shows no cache hits in GitHub Actions.Likely causes โ Cache scope differs per workflow/branch, cache evicted (10 GB repo limit), mode=max not set, or the Dockerfile changes early layers, or the cache backend isn't configured because the Actions runtime token isn't exposed to the step.
Diagnose โ Look for importing cache manifest from gha in logs; check the Actions cache UI.
Fix โ Use scope=, mode=max, use docker/build-push-action with docker/setup-buildx-action, or switch to registry cache.
Prevent โ Keep a stable early-layer structure.
Containers that exit, crash or misbehave
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q51 Container exits immediately with code 0 right after docker run -d.
Beginner
docker run -d.Likely causes โ The main process finished (a shell with no TTY, a script that ends, a daemon that forks into the background).
Diagnose โ
docker ps -a
docker logs c
docker inspect -f '{{.Config.Cmd}} {{.Config.Entrypoint}}' cFix โ Run the service in the foreground (nginx -g 'daemon off;'), or use -it for shells. A container lives as long as PID 1.
Prevent โ Use images whose CMD is a foreground process.
Q52 Exited (137) with no OOM flag.
Intermediate
Exited (137) with no OOM flag.Likely causes โ SIGKILL: docker kill, a stop timeout expiry, host OOM killer (outside cgroup limit), or an orchestrator eviction.
Diagnose โ
docker inspect -f '{{.State.OOMKilled}} {{.State.ExitCode}}' c
dmesg -T | grep -i -E 'killed process|oom'
docker events --since 1h --filter container=cFix โ If host OOM, add memory or limits; if timeout, handle SIGTERM and raise --stop-timeout.
Prevent โ Set memory limits so the kernel kills inside the cgroup, not randomly on the host.
Q53 Exited (139) segmentation fault.
Advanced
Exited (139) segmentation fault.Likely causes โ Binary built for different libc (glibc vs musl) or CPU features, native module crash, emulated amd64 on arm64 running a JIT, or a genuine app bug.
Diagnose โ
docker run --rm --entrypoint sh image -c 'uname -m; ldd /app/bin'
docker run --platform linux/amd64 ...
dmesg | grep segfaultFix โ Match base and architecture, rebuild native modules, enable core dumps (--ulimit core=-1) and analyze with gdb.
Prevent โ Test images on the real target architecture.
Q54 Exited (126) / Exited (127).
Beginner
Exited (126) / Exited (127).Likely causes โ 126: command found but not executable; 127: command not found (or missing shebang interpreter).
Diagnose โ docker run --rm --entrypoint sh image -c 'ls -l /app; which myapp'
Fix โ chmod +x, correct the PATH/absolute path, install the missing binary, fix CRLF.
Prevent โ Use exec form with absolute paths and add a smoke test.
Q55 exec /entrypoint.sh: exec format error
Intermediate
exec /entrypoint.sh: exec format errorLikely causes โ Script lacks a shebang, or image architecture differs from host (arm64 image on amd64).
Diagnose โ
docker image inspect image -f '{{.Os}}/{{.Architecture}}'
docker run --rm --entrypoint head image -1 /entrypoint.shFix โ Add #!/bin/sh, pull the right --platform, build multi-arch.
Prevent โ Publish multi-arch manifests.
Q56 docker run says WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and the app is very slow.
Beginner
docker run says WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and the app is very slow.Likely causes โ Running amd64 image under emulation on Apple Silicon.
Diagnose โ docker image inspect img -f '{{.Architecture}}'; docker info | grep Architecture.
Fix โ Pull a native arm64 variant (--platform linux/arm64), rebuild multi-arch, or enable Rosetta in Docker Desktop.
Prevent โ Ship multi-arch images.
Q57 App crashes with Error: listen EADDRINUSE: address already in use :::3000 inside the container.
Beginner
Error: listen EADDRINUSE: address already in use :::3000 inside the container.Likely causes โ Two processes in the container on the same port (e.g. nodemon plus a second start), or a restarted process before the old one released the port.
Diagnose โ docker exec c ss -tlnp (or netstat), docker top c.
Fix โ Run a single process, fix the dev script, use --init to reap.
Prevent โ One process per container.
Q58 Container works with docker run -it but fails when started detached with -d.
Intermediate
docker run -it but fails when started detached with -d.Likely causes โ The app expects a TTY or stdin (interactive prompts), or reads from stdin and gets EOF.
Diagnose โ docker logs c; compare with docker run -d -t.
Fix โ Provide config non-interactively, use -t/-i only if truly needed, or tail -f /dev/null for dev placeholder (not prod).
Prevent โ Make apps non-interactive.
Q59 docker exec returns OCI runtime exec failed: exec failed: unable to start container process: exec: "bash": executable file not found in $PATH
Beginner
docker exec returns OCI runtime exec failed: exec failed: unable to start container process: exec: "bash": executable file not found in $PATHLikely causes โ Alpine/distroless/slim image without bash.
Diagnose โ docker exec c sh -c 'cat /etc/os-release'
Fix โ Use sh, or docker debug c, or attach a debug container sharing namespaces.
Prevent โ Do not depend on bash in minimal images.
Q60 docker exec fails with cannot exec in a stopped container or container is not running.
Beginner
docker exec fails with cannot exec in a stopped container or container is not running.Likely causes โ Container crashed or exited.
Diagnose โ docker ps -a, docker logs c, docker inspect -f '{{.State.Error}}' c.
Fix โ Find out why it exited; to inspect its filesystem use docker cp c:/path . or docker run --rm -it --entrypoint sh image.
Prevent โ Alert on restart count.
Q61 Environment variable set with -e but the app doesn't see it.
Intermediate
-e but the app doesn't see it.Likely causes โ Flag placed after the image name (treated as command args), typo, entrypoint script sanitises env, app reads a config file instead.
Diagnose โ
docker exec c env | sort
docker inspect -f '{{.Config.Env}}' cFix โ docker run -e FOO=bar image (options before image). Check how the app reads variables.
Prevent โ Print effective config on startup (without secrets).
Q62 docker run argument is ignored: docker run image --port 9000 fails with unknown flag.
Intermediate
docker run argument is ignored: docker run image --port 9000 fails with unknown flag.Likely causes โ Args after the image replace CMD entirely (and are appended to ENTRYPOINT).
Diagnose โ docker inspect -f '{{.Config.Entrypoint}} {{.Config.Cmd}}' image
Fix โ Pass the full command (image app --port 9000) when only CMD is defined; with ENTRYPOINT pass only the extra args; override with --entrypoint.
Prevent โ Document the entrypoint contract.
Q63 PID 1 app doesn't reload on SIGHUP or ignores Ctrl+C in docker run -it.
Advanced
docker run -it.Likely causes โ PID 1 has no default signal handlers; a signal without a handler is ignored.
Diagnose โ docker exec c cat /proc/1/status | grep -E 'SigCgt|SigIgn'
Fix โ Run --init, or have the app install handlers (Node: process.on('SIGTERM')).
Prevent โ Test docker stop time in CI.
Q64 Container shows Up but the app returns 502 / connection refused from the host on published port.
Intermediate
Up but the app returns 502 / connection refused from the host on published port.Likely causes โ App listens on 127.0.0.1 inside the container instead of 0.0.0.0, wrong container port, or the app hasn't finished booting.
Diagnose โ
docker exec c ss -tlnp
docker port c
curl -v localhost:8080Fix โ Bind the app to 0.0.0.0 (e.g. flask run --host 0.0.0.0) and publish the right port.
Prevent โ Add a health check hitting the published path.
Q65 standard_init_linux.go:228: exec user process caused: exec format error on a Raspberry Pi.
Intermediate
standard_init_linux.go:228: exec user process caused: exec format error on a Raspberry Pi.Likely causes โ Image is amd64 only.
Diagnose โ uname -m; docker manifest inspect image | jq '.manifests[].platform'.
Fix โ Use an image with linux/arm64 or linux/arm/v7, or rebuild with buildx.
Prevent โ Publish multi-arch images.
Q66 Container time/zone is wrong in logs.
Beginner
Likely causes โ Containers default to UTC and slim images lack tzdata.
Diagnose โ docker exec c date; docker exec c ls /usr/share/zoneinfo | head.
Fix โ Install tzdata and set TZ, or mount /etc/localtime:ro.
Prevent โ Log in UTC and convert at display time.
Q67 Error: Cannot find module in container but works on the host.
Intermediate
Error: Cannot find module in container but works on the host.Likely causes โ node_modules excluded by .dockerignore but npm install not run, a bind mount shadowing /app/node_modules, or platform-specific native modules built on the host.
Diagnose โ
docker run --rm image ls /app/node_modules | head
docker inspect -f '{{json .Mounts}}' cFix โ Install dependencies in the image, mask node_modules with a named volume when bind mounting, never copy host node_modules.
Prevent โ .dockerignore with node_modules and npm ci in the Dockerfile.
Q68 Python app prints nothing to docker logs until the container stops.
Intermediate
docker logs until the container stops.Likely causes โ stdout buffering when not attached to a TTY.
Diagnose โ Compare docker run -t vs -d.
Fix โ ENV PYTHONUNBUFFERED=1 or python -u; configure logging handlers to stream.
Prevent โ Set the variable in the base image.
Q69 OCI runtime create failed: ... mount: /proc: permission denied or similar from nested containers.
Advanced
OCI runtime create failed: ... mount: /proc: permission denied or similar from nested containers.Likely causes โ Running containers inside a restricted container/LXC/CI sandbox without needed capabilities or with masked /proc.
Diagnose โ cat /proc/self/status | grep Cap; check the outer environment's security profile.
Fix โ Use a runtime that supports nesting (Sysbox), enable nesting in LXC, or use rootless with proper setup.
Prevent โ Prefer daemonless/remote builds over nested runtimes.
Q70 Container cannot write to a mounted directory: Permission denied / EACCES.
Intermediate
Permission denied / EACCES.Likely causes โ UID mismatch between container user and host directory owner, read-only mount (:ro), SELinux label missing, or read-only root filesystem.
Diagnose โ
docker exec c id
ls -ln /host/dir
docker inspect -f '{{json .Mounts}}' c
ls -Z /host/dir # SELinuxFix โ chown to the container UID, run with --user, add :z/:Z, drop :ro.
Prevent โ Define fixed numeric UIDs.
Q71 Application can't resolve its own hostname or sudo: unable to resolve host.
Intermediate
sudo: unable to resolve host.Likely causes โ Custom --hostname or --network host produce mismatched /etc/hosts; or /etc/hosts overwritten.
Diagnose โ docker exec c cat /etc/hosts; hostname
Fix โ Use --add-host name:ip, don't edit /etc/hosts manually (it's regenerated on start).
Prevent โ Rely on DNS names, not hosts files.
Q72 After docker stop a container takes exactly 10 seconds every time.
Beginner
docker stop a container takes exactly 10 seconds every time.Likely causes โ Process ignores SIGTERM (shell form entrypoint, PID 1 without handler).
Diagnose โ docker inspect -f '{{.Config.Entrypoint}} {{.Config.Cmd}}' c; docker exec c ps.
Fix โ Exec form, exec "$@" in scripts, --init, or docker stop -t.
Prevent โ Measure stop time in smoke tests.
Q73 Debug a container that crashes before you can exec into it.
Intermediate
exec into it.Likely causes โ Startup error.
Diagnose โ
docker logs --tail 200 c
docker run --rm -it --entrypoint sh image
docker commit c debug-img && docker run --rm -it --entrypoint sh debug-img
docker run --rm -it --volumes-from c --entrypoint sh imageFix โ Reproduce with the same env and mounts, run the entrypoint manually (sh -x /entrypoint.sh).
Prevent โ Make entrypoints verbose on error and log configuration validation.
Q74 docker cp fails: Error: No such container:path or copies nothing from a volume path.
Intermediate
docker cp fails: Error: No such container:path or copies nothing from a volume path.Likely causes โ Wrong path, the path is a tmpfs mount (not supported by docker cp), or the container doesn't exist.
Diagnose โ docker exec c ls -l /path; docker inspect -f '{{json .Mounts}}' c.
Fix โ Copy from a regular path, or use a helper container with --volumes-from; use docker exec c tar c ... | tar x.
Prevent โ Know which paths are tmpfs.
Q75 unable to find image 'myapp:latest' locally followed by pull access denied for myapp, repository does not exist or may require 'docker login'
Beginner
unable to find image 'myapp:latest' locally followed by pull access denied for myapp, repository does not exist or may require 'docker login'Likely causes โ Image was never built locally (or built with another tag/context), or the name lacks a registry prefix and Docker tries Docker Hub.
Diagnose โ docker images | grep myapp; docker context ls (maybe building on a different daemon).
Fix โ Build with -t myapp:latest against the same daemon, or use the full name reg.example.com/team/myapp:latest.
Prevent โ Consistent naming and DOCKER_HOST awareness.
Networking, DNS and Compose
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q76 curl: (7) Failed to connect to localhost port 8080: Connection refused after docker run -p 8080:80 nginx.
Beginner
curl: (7) Failed to connect to localhost port 8080: Connection refused after docker run -p 8080:80 nginx.Likely causes โ Container not running, mapping reversed (-p 80:8080), app listening on another port or only on loopback, or the request is from another host while docker is remote.
Diagnose โ
docker ps
docker port web
docker exec web ss -tlnp
ss -tlnp | grep 8080Fix โ Use -p hostPort:containerPort correctly, bind 0.0.0.0 in the app.
Prevent โ Verify with docker port after starting.
Q77 Bind for 0.0.0.0:5432 failed: port is already allocated
Beginner
Bind for 0.0.0.0:5432 failed: port is already allocatedLikely causes โ Another container or host process uses that port.
Diagnose โ
sudo ss -tlnp | grep 5432
docker ps --format '{{.Names}} {{.Ports}}' | grep 5432Fix โ Stop the other process, or map another host port (-p 5433:5432), or drop the publish.
Prevent โ Don't publish DB ports; use internal networks.
Q78 Containers cannot reach the internet: Temporary failure in name resolution
Advanced
Temporary failure in name resolutionLikely causes โ DNS config (host uses 127.0.0.53 stub), IP forwarding off, firewall blocking forward, or VPN conflict.
Diagnose โ
docker run --rm busybox nslookup google.com
docker run --rm busybox ping -c1 1.1.1.1
sysctl net.ipv4.ip_forward
iptables -t nat -L POSTROUTING -n | grep MASQFix โ Set "dns": ["1.1.1.1"] or corp DNS in daemon.json; enable net.ipv4.ip_forward=1; restart docker.
Prevent โ Standardize host DNS and forwarding sysctls.
Q79 ping works to IPs but DNS names fail on the default bridge: ping: bad address 'db'
Beginner
ping works to IPs but DNS names fail on the default bridge: ping: bad address 'db'Likely causes โ Default bridge has no name-based discovery.
Diagnose โ docker network inspect bridge.
Fix โ Use a user-defined network or Compose.
Prevent โ Never rely on the default bridge.
Q80 getaddrinfo ENOTFOUND db in a Compose app.
Beginner
getaddrinfo ENOTFOUND db in a Compose app.Likely causes โ Service name typo, services on different networks, or the DB container exited.
Diagnose โ
docker compose ps
docker compose exec api getent hosts db
docker network inspect <project>_defaultFix โ Use the exact service name, put services on a shared network, fix the DB crash.
Prevent โ Define networks explicitly and add health-gated depends_on.
Q81 Compose: service "api" depends on undefined service "db"
Beginner
service "api" depends on undefined service "db"Likely causes โ Service missing, defined under a profile that isn't active, or in an un-merged override file.
Diagnose โ docker compose config --services; docker compose --profile x config.
Fix โ Define the service or activate the profile; pass all -f files.
Prevent โ Run docker compose config in CI.
Q82 Compose: yaml: line 14: mapping values are not allowed in this context
Beginner
yaml: line 14: mapping values are not allowed in this contextLikely causes โ Indentation/tab error, missing space after colon, or unquoted special characters (: in values, @, *).
Diagnose โ docker compose config; yamllint compose.yaml.
Fix โ Use spaces only, quote strings like "8080:80", "${VAR:-x}".
Prevent โ Editor YAML linting.
Q83 Compose: The "DB_PASSWORD" variable is not set. Defaulting to a blank string.
Beginner
The "DB_PASSWORD" variable is not set. Defaulting to a blank string.Likely causes โ .env missing/not in the project dir, variable only exported in a different shell, or typo.
Diagnose โ docker compose config | grep -i password; ls -la .env.
Fix โ Create .env next to compose file or use --env-file; require it with ${DB_PASSWORD:?missing}.
Prevent โ Fail fast using :? syntax.
Q84 Error response from daemon: network xxx not found on docker compose up.
Intermediate
Error response from daemon: network xxx not found on docker compose up.Likely causes โ A network was removed outside Compose while containers still reference it.
Diagnose โ docker network ls; docker compose ps -a.
Fix โ docker compose down then up -d (or up --force-recreate).
Prevent โ Don't delete networks manually; use docker compose down.
Q85 Error response from daemon: Pool overlaps with other one on this address space
Advanced
Error response from daemon: Pool overlaps with other one on this address spaceLikely causes โ A custom subnet collides with an existing network or host route.
Diagnose โ
docker network ls -q | xargs docker network inspect -f '{{.Name}} {{range .IPAM.Config}}{{.Subnet}}{{end}}'
ip routeFix โ Choose a free subnet, remove unused networks, set default-address-pools.
Prevent โ Central IP plan for Docker ranges.
Q86 could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network
Intermediate
could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the networkLikely causes โ Too many networks (each Compose project takes a /16 by default) have exhausted the default pools.
Diagnose โ docker network ls | wc -l
Fix โ docker network prune; configure smaller pools: "default-address-pools":[{"base":"10.10.0.0/16","size":24}].
Prevent โ Use /24 pools and clean up CI networks.
Q87 Container-to-container requests fail intermittently by name after a container restarts.
Advanced
Likely causes โ Client (nginx, JVM) cached the old IP; DNS TTL and resolver caches ignore the new address.
Diagnose โ docker exec web getent hosts api vs the IP in nginx upstream; docker network inspect.
Fix โ In nginx use resolver 127.0.0.11 valid=10s; with variable in proxy_pass; JVM networkaddress.cache.ttl=10; or reload nginx.
Prevent โ Configure resolver behaviour when using dynamic backends.
Q88 Published port is reachable from the internet though ufw denies it.
Advanced
ufw denies it.Likely causes โ Docker's DNAT rules bypass ufw's INPUT rules.
Diagnose โ iptables -t nat -S DOCKER; scan with nmap -p 8080 host.
Fix โ Bind 127.0.0.1:8080:80, or add rules to DOCKER-USER, or use ufw-docker tooling, or set "iptables": false (with caution).
Prevent โ Publish only what needs to be public.
Q89 Access from container to host service fails: connection refused host.docker.internal on Linux.
Intermediate
connection refused host.docker.internal on Linux.Likely causes โ Name not defined on Linux by default, or the host service binds only to 127.0.0.1, or a firewall blocks the bridge interface.
Diagnose โ
docker run --rm --add-host host.docker.internal:host-gateway busybox getent hosts host.docker.internal
ss -tlnp | grep <port>Fix โ Add extra_hosts, bind the service to 0.0.0.0 or the bridge IP, allow docker0 in the firewall.
Prevent โ Prefer running dependencies as containers.
Q90 Slow DNS: every outbound call in the container takes 5 seconds.
Advanced
Likely causes โ AAAA lookups failing or timing out (no IPv6), conntrack race on UDP DNS, unreachable first resolver, ndots:5 search-list expansion.
Diagnose โ
docker exec c cat /etc/resolv.conf
docker exec c sh -c 'time getent hosts example.com'
tcpdump -ni any port 53Fix โ Remove dead resolvers, use options single-request-reopen, set --dns-opt ndots:1, use fully qualified names with trailing dot, disable IPv6 where unused.
Prevent โ Run a local caching resolver.
Q91 Error response from daemon: user specified IP address is supported only when connecting to networks with user configured subnets
Intermediate
Error response from daemon: user specified IP address is supported only when connecting to networks with user configured subnetsLikely causes โ --ip used on the default bridge.
Diagnose โ docker network inspect <net> | jq '.[0].IPAM'
Fix โ Create a network with --subnet and attach to it.
Prevent โ Avoid static IPs.
Q92 Inter-host overlay network: containers on different nodes cannot ping.
Advanced
Likely causes โ Firewall blocks 4789/udp (VXLAN), 7946, 2377; MTU too high; clock skew; cloud security groups.
Diagnose โ
docker node ls
nc -zvu node2 4789
ss -ulnp | grep 4789
docker network inspect <overlay>Fix โ Open ports between nodes, lower overlay MTU (--opt com.docker.network.driver.mtu=1450), sync time.
Prevent โ Provision security groups via IaC.
Q93 docker compose up creates new network every time and docker network ls is full of them.
Beginner
docker compose up creates new network every time and docker network ls is full of them.Likely causes โ Changing project name (-p, directory names, COMPOSE_PROJECT_NAME) between runs, or CI jobs leaving networks behind.
Diagnose โ docker network ls --filter label=com.docker.compose.project.
Fix โ Use docker compose down in cleanup; docker network prune; fix the project name.
Prevent โ Set name: at the top of compose.yaml.
Q94 Port mapping works on host but not from another machine on the LAN.
Intermediate
Likely causes โ Bound to 127.0.0.1, cloud security group/firewall blocking, wrong IP.
Diagnose โ docker port c; ss -tlnp; curl from another host; nc -zv ip port.
Fix โ Publish on 0.0.0.0 (or remove the 127.0.0.1 prefix) and open the firewall.
Prevent โ Document intended exposure.
Q95 Websocket / long-lived connections drop through the Docker proxy after a while.
Advanced
Likely causes โ conntrack/NAT timeouts, idle timeouts at upstream load balancer, missing keepalives.
Diagnose โ conntrack -L | grep <port>; sysctl net.netfilter.nf_conntrack_tcp_timeout_established; check LB idle settings.
Fix โ Enable TCP/app-level keepalives shorter than the timeout, tune idle timeouts, raise conntrack limits.
Prevent โ Application heartbeat.
Q96 nginx: [emerg] host not found in upstream "api" in /etc/nginx/conf.d/default.conf:3
Beginner
nginx: [emerg] host not found in upstream "api" in /etc/nginx/conf.d/default.conf:3Likely causes โ nginx started before api was resolvable (not up or different network); nginx resolves upstreams at startup.
Diagnose โ docker compose ps; docker compose exec nginx getent hosts api.
Fix โ Start order with depends_on, same network, or use a resolver 127.0.0.11 plus variable-based proxy_pass.
Prevent โ Health-gated startup.
Q97 Connection from container to DB connection reset by peer only under load.
Advanced
connection reset by peer only under load.Likely causes โ Conntrack table full (nf_conntrack: table full, dropping packet), DB max connections, ephemeral port exhaustion, idle connection killed by NAT.
Diagnose โ
dmesg | grep conntrack
sysctl net.netfilter.nf_conntrack_count net.netfilter.nf_conntrack_max
ss -sFix โ Raise nf_conntrack_max, use connection pooling, increase port range, tune keepalive.
Prevent โ Monitor conntrack usage.
Q98 docker compose up error: Bind for 0.0.0.0:80 failed: port is already allocated while nothing seems to listen.
Intermediate
docker compose up error: Bind for 0.0.0.0:80 failed: port is already allocated while nothing seems to listen.Likely causes โ A stale docker-proxy or a stopped container still holding the mapping, or another Compose project.
Diagnose โ
docker ps -a --filter publish=80
sudo ss -tlnp | grep ':80 '
ps aux | grep docker-proxyFix โ Remove the old container (docker rm -f), docker compose down --remove-orphans, restart Docker if the proxy is orphaned.
Prevent โ Use --remove-orphans.
Q99 network <name> declared as external, but could not be found
Beginner
network <name> declared as external, but could not be foundLikely causes โ The external network was never created.
Diagnose โ docker network ls | grep <name>.
Fix โ docker network create <name> first; or remove external: true so Compose creates it.
Prevent โ Create shared networks in a bootstrap script.
Q100 Container sees the wrong source IP (always the gateway 172.x) behind published ports.
Advanced
Likely causes โ Userland proxy or masquerade replaces client IP, especially on Docker Desktop or with IPv6 to IPv4 translation.
Diagnose โ docker logs web shows 172.18.0.1; check "userland-proxy" setting.
Fix โ Use --network host for the edge proxy, run the reverse proxy on the host, use PROXY protocol or X-Forwarded-For, disable userland-proxy where acceptable.
Prevent โ Terminate TLS at a proxy that adds X-Forwarded-For.
Storage, volumes and disk space
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q101 no space left on device while pulling an image or starting a container.
Beginner
no space left on device while pulling an image or starting a container.Likely causes โ /var/lib/docker partition full (images, build cache, logs, volumes) or inodes exhausted.
Diagnose โ
df -h /var/lib/docker; df -i /var/lib/docker
docker system df -vFix โ docker system prune -a (review first), docker builder prune, truncate huge logs, expand the disk, or move data-root.
Prevent โ Separate disk, log rotation, scheduled pruning and alerts at 80%.
Q102 df shows free space but Docker says no space: inodes at 100%.
Advanced
df shows free space but Docker says no space: inodes at 100%.Likely causes โ Millions of small files (node_modules layers, many tiny containers) exhaust inodes.
Diagnose โ df -i; find /var/lib/docker -xdev -printf '%h\n' | sort | uniq -c | sort -rn | head.
Fix โ Prune images/containers, rebuild fs with more inodes (ext4 -N) or use XFS.
Prevent โ Prefer XFS for Docker data and slim images.
Q103 /var/lib/docker/containers/<id>/<id>-json.log is 50 GB.
Beginner
/var/lib/docker/containers/<id>/<id>-json.log is 50 GB.Likely causes โ json-file driver without rotation and a chatty app.
Diagnose โ ls -lhS /var/lib/docker/containers/*/*-json.log | head
Fix โ Immediately truncate -s 0 <file>; set max-size/max-file or local driver in daemon.json; recreate containers.
Prevent โ Global log rotation and less verbose logging.
Q104 docker system prune did not free much although docker system df shows large "Reclaimable".
Intermediate
docker system prune did not free much although docker system df shows large "Reclaimable".Likely causes โ Images still referenced by stopped containers or tags, build cache not included, or volumes need --volumes.
Diagnose โ docker system df -v; docker ps -a.
Fix โ docker container prune, docker image prune -a, docker builder prune -a, docker volume prune (carefully).
Prevent โ Targeted cleanup jobs per resource type.
Q105 Volume data disappeared after docker compose down -v or docker volume prune.
Intermediate
docker compose down -v or docker volume prune.Likely causes โ -v deletes named volumes; prune removes unused volumes.
Diagnose โ docker volume ls; check shell history; look for backups.
Fix โ Restore from backup; if none, data is gone (try filesystem snapshot or undelete tools on /var/lib/docker/volumes).
Prevent โ Backups; guard destructive commands; label volumes and use docker volume prune --filter label!=keep.
Q106 Data is not persisted: after container recreate the database is empty.
Intermediate
Likely causes โ Wrong mount path, anonymous volume created (image's VOLUME) so a new one appears each time, or Compose project name changed so the volume name differs.
Diagnose โ
docker inspect -f '{{json .Mounts}}' db
docker volume lsFix โ Mount a named volume at the exact data directory, reuse the same project/volume name (name: in compose volume).
Prevent โ Explicit named volumes with fixed name:.
Q107 docker: Error response from daemon: invalid mount config for type "bind": bind source path does not exist
Beginner
docker: Error response from daemon: invalid mount config for type "bind": bind source path does not existLikely causes โ Host path missing (--mount does not create it) or typo; on Docker Desktop, path not shared.
Diagnose โ ls -ld /host/path; Docker Desktop file-sharing settings.
Fix โ Create the directory, fix path, add it to shared paths.
Prevent โ Use $PWD absolute paths and named volumes.
Q108 Bind mount of a single file shows stale content after editing it on host.
Intermediate
Likely causes โ Editor replaced the file (new inode) so the container still sees the old inode.
Diagnose โ stat -c %i file before/after save; docker exec c cat file.
Fix โ Mount the parent directory, or restart the container, or edit in place (cat > file).
Prevent โ Mount directories rather than single files.
Q109 MySQL/Postgres refuses to start: initdb: error: directory "/var/lib/postgresql/data" exists but is not empty
Advanced
initdb: error: directory "/var/lib/postgresql/data" exists but is not emptyLikely causes โ Volume root contains lost+found (ext4 mount point) or leftover files.
Diagnose โ docker run --rm -v pgdata:/d alpine ls -la /d.
Fix โ Mount a subdirectory: -v pgdata:/var/lib/postgresql/data with PGDATA=/var/lib/postgresql/data/pgdata, or clean the directory if it is truly disposable.
Prevent โ Set PGDATA to a subfolder for block-device mounts.
Q110 Postgres: FATAL: data directory "/var/lib/postgresql/data" has wrong ownership
Intermediate
FATAL: data directory "/var/lib/postgresql/data" has wrong ownershipLikely causes โ Host bind mount owned by another UID; permissions not 0700.
Diagnose โ ls -ldn /host/pgdata; docker exec db id postgres.
Fix โ chown -R 999:999 /host/pgdata; chmod 700, or use a named volume.
Prevent โ Prefer named volumes for databases.
Q111 docker volume rm says volume is in use.
Beginner
docker volume rm says volume is in use.Likely causes โ A running or stopped container still references it.
Diagnose โ docker ps -a --filter volume=<name>
Fix โ docker rm -f those containers, then remove the volume.
Prevent โ Use docker compose down to clean up consistently.
Q112 Files created in a bind mount are owned by root on the host.
Intermediate
Likely causes โ Container process runs as root.
Diagnose โ ls -ln; docker exec c id.
Fix โ docker run --user $(id -u):$(id -g); set user: in Compose; use rootless Docker (maps root to your UID).
Prevent โ Run non-root.
Q113 SELinux: Permission denied accessing a bind-mounted directory on RHEL/Fedora.
Intermediate
Permission denied accessing a bind-mounted directory on RHEL/Fedora.Likely causes โ Host directory has no container_file_t label.
Diagnose โ ls -Z /host/dir; ausearch -m avc -ts recent.
Fix โ Add :z (shared) or :Z (private) to the mount, or chcon -Rt container_file_t /host/dir. Never mount /home or / with :Z.
Prevent โ Keep SELinux enforcing and label volumes.
Q114 Slow file I/O on bind mounts with Docker Desktop (npm install, composer).
Intermediate
Likely causes โ File sharing between host and VM adds per-file overhead.
Diagnose โ Compare timing inside container on a named volume vs bind mount.
Fix โ Use VirtioFS, keep dependencies in named volumes, use Compose develop.watch sync.
Prevent โ Store heavy-write paths in volumes.
Q115 docker save / docker load fails with unexpected EOF or invalid tar header.
Intermediate
docker save / docker load fails with unexpected EOF or invalid tar header.Likely causes โ Truncated transfer, disk full during save, gzip mismatch.
Diagnose โ tar tf image.tar | head; sha256sum on both ends; df -h.
Fix โ Re-save and verify checksums; docker save img | gzip > img.tgz and gunzip -c | docker load.
Prevent โ Verify digests after transfer, or use skopeo copy with oci-archive.
Q116 Error response from daemon: failed to mount overlay: ... invalid argument
Advanced
Error response from daemon: failed to mount overlay: ... invalid argumentLikely causes โ Backing filesystem lacks d_type support (XFS with ftype=0), unsupported fs (e.g. some NFS, ecryptfs), or overlay kernel module missing.
Diagnose โ
docker info | grep -E 'Storage Driver|Backing Filesystem|Supports d_type'
xfs_info /var/lib/docker | grep ftype
lsmod | grep overlayFix โ Recreate the filesystem with ftype=1, or move data-root to ext4/XFS local disk, modprobe overlay.
Prevent โ Provision /var/lib/docker with a supported fs.
Q117 docker pull fails: failed to register layer: ... no space left on device though df shows space.
Advanced
docker pull fails: failed to register layer: ... no space left on device though df shows space.Likely causes โ Inodes, a quota (pquota/--storage-opt), or the layer extraction temp directory (/var/lib/docker/tmp) on a different small mount.
Diagnose โ df -h /var/lib/docker /var/lib/docker/tmp /tmp; df -i; docker info.
Fix โ Free or expand; set DOCKER_TMPDIR on a larger disk.
Prevent โ Monitor all relevant mounts.
Q118 Container writable layer huge: docker ps -s shows SIZE 20GB (virtual 21GB).
Intermediate
docker ps -s shows SIZE 20GB (virtual 21GB).Likely causes โ App writes data/logs/temp files into the container FS.
Diagnose โ docker ps -s; docker diff c | head; docker exec c du -xh / | sort -h | tail.
Fix โ Move data to volumes, clean temp files, add log rotation.
Prevent โ Read-only root FS reveals such writes early.
Q119 Docker Desktop VM disk is full and docker system prune doesn't shrink the disk image.
Advanced
docker system prune doesn't shrink the disk image.Likely causes โ The virtual disk (Docker.raw/VHDX) grows but doesn't automatically shrink.
Diagnose โ Desktop Settings > Resources shows usage; docker system df.
Fix โ Prune, then use Desktop's "Clean / Purge data", reduce the disk limit, or compact the VHDX (Optimize-VHD) on Windows.
Prevent โ Set a disk image size limit and prune regularly.
Q120 Moving /var/lib/docker to a new disk broke everything: Error starting daemon: ... mkdir ... permission denied.
Advanced
/var/lib/docker to a new disk broke everything: Error starting daemon: ... mkdir ... permission denied.Likely causes โ Copy without preserving ownership/xattrs/SELinux labels, or wrong data-root path.
Diagnose โ journalctl -u docker; ls -ld /newpath; getfattr.
Fix โ systemctl stop docker; rsync -aHAXS /var/lib/docker/ /data/docker/; set "data-root": "/data/docker"; restart.
Prevent โ Use rsync -aHAXS and test on a staging host.
Q121 Volume shared via NFS: mount.nfs: access denied by server while mounting.
Intermediate
mount.nfs: access denied by server while mounting.Likely causes โ Export doesn't allow the client IP, root_squash, wrong NFS version/path.
Diagnose โ
showmount -e nfs-server
sudo mount -t nfs4 nfs-server:/exports/app /mnt/test
exportfs -v # on serverFix โ Fix /etc/exports, exportfs -ra, correct device and addr in volume options.
Prevent โ Test mounts on every node before deploying.
Q122 Database corrupted after the host lost power: PANIC: could not locate a valid checkpoint record.
Advanced
PANIC: could not locate a valid checkpoint record.Likely causes โ Unclean shutdown plus storage ignoring fsync (write cache without battery), or copied files from a running DB.
Diagnose โ Check WAL files, disk write-cache settings, filesystem errors in dmesg.
Fix โ Restore from backup/PITR; as a last resort pg_resetwal (data loss risk).
Prevent โ Reliable storage, replication, tested backups, and don't snapshot running DB files without proper tooling.
Q123 Image layers listed under /var/lib/docker/overlay2 but not in docker images (orphaned).
Advanced
/var/lib/docker/overlay2 but not in docker images (orphaned).Likely causes โ Interrupted pulls/builds or daemon crash leaving layer dirs.
Diagnose โ du -sh /var/lib/docker/overlay2; compare with docker system df.
Fix โ docker system prune -a; if still large, stop Docker, back up, and clear /var/lib/docker for a rebuild (images re-pulled, volumes backed up first).
Prevent โ Avoid killing dockerd with SIGKILL; keep disks healthy.
Q124 docker run --tmpfs /tmp:size=64m app dies with No space left on device writing temp files.
Beginner
docker run --tmpfs /tmp:size=64m app dies with No space left on device writing temp files.Likely causes โ tmpfs limit too small.
Diagnose โ docker exec c df -h /tmp.
Fix โ Increase size=, or write large temp files to a volume.
Prevent โ Size tmpfs from observed use and remember it consumes memory.
Q125 chown: changing ownership of '/var/lib/mysql/...': Operation not permitted at container start.
Intermediate
chown: changing ownership of '/var/lib/mysql/...': Operation not permitted at container start.Likely causes โ Bind mount on NFS with root_squash, a Windows/macOS file share, or rootless user namespaces where chown to a mapped UID is not allowed.
Diagnose โ mount | grep <path>; docker exec c id.
Fix โ Use a named volume, fix export options (no_root_squash or proper UID), or map user: to the owner.
Prevent โ Avoid databases on network/shared filesystems.
Registry, pull and push errors
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q126 Error response from daemon: pull access denied for X, repository does not exist or may require 'docker login'
Intermediate
Error response from daemon: pull access denied for X, repository does not exist or may require 'docker login'Likely causes โ Typo in the name, private repo without login, or a repo that doesn't exist for that tag/namespace.
Diagnose โ
docker login
docker manifest inspect X:tagFix โ Correct the name (include namespace, e.g. library/ implied for official), log in with an account that has pull rights.
Prevent โ Use full registry paths and test pulls in CI.
Q127 manifest for myapp:1.2 not found: manifest unknown: manifest unknown
Beginner
manifest for myapp:1.2 not found: manifest unknown: manifest unknownLikely causes โ Tag does not exist (not pushed, deleted by retention policy, typo), or it exists but not for your platform.
Diagnose โ crane ls reg/myapp | grep 1.2; docker buildx imagetools inspect reg/myapp:1.2.
Fix โ Push the tag, rebuild, or use an existing one.
Prevent โ Retention rules protect release tags.
Q128 no matching manifest for linux/arm64/v8 in the manifest list entries
Intermediate
no matching manifest for linux/arm64/v8 in the manifest list entriesLikely causes โ Image published only for amd64.
Diagnose โ docker buildx imagetools inspect image | grep Platform.
Fix โ docker pull --platform linux/amd64 image (emulated), find an arm64 build, or build your own multi-arch.
Prevent โ Publish multi-platform manifests.
Q129 x509: certificate signed by unknown authority on docker pull from a private registry.
Intermediate
x509: certificate signed by unknown authority on docker pull from a private registry.Likely causes โ Self-signed or internal CA not trusted by the daemon.
Diagnose โ openssl s_client -connect reg.example.com:443 -showcerts </dev/null.
Fix โ Put the CA at /etc/docker/certs.d/reg.example.com/ca.crt (no restart needed) or into the system trust store, then retry.
Prevent โ Use certificates from a trusted CA (ACME, internal PKI distributed to hosts).
Q130 http: server gave HTTP response to HTTPS client
Beginner
http: server gave HTTP response to HTTPS clientLikely causes โ Registry serves plain HTTP (e.g. local registry:2) but the client tries HTTPS.
Diagnose โ curl -v http://host:5000/v2/.
Fix โ Enable TLS on the registry (preferred), or add to insecure-registries in daemon.json and restart (non-prod only).
Prevent โ Always terminate TLS at the registry.
Q131 unauthorized: authentication required on push to GitHub Container Registry.
Intermediate
unauthorized: authentication required on push to GitHub Container Registry.Likely causes โ Token lacks write:packages, not logged in to ghcr.io, or repo/package permissions not granting the workflow.
Diagnose โ docker login ghcr.io -u USER; check package settings > Manage Actions access.
Fix โ Use a PAT with write:packages or GITHUB_TOKEN with packages: write permission in the workflow; lowercase the image name.
Prevent โ Grant least privilege explicitly in the workflow permissions:.
Q132 ECR: denied: Your authorization token has expired. Reauthenticate and try again.
Beginner
denied: Your authorization token has expired. Reauthenticate and try again.Likely causes โ ECR tokens last 12 hours.
Diagnose โ Check when you logged in.
Fix โ
aws ecr get-login-password --region ap-south-1 | \
docker login --username AWS --password-stdin 123456789012.dkr.ecr.ap-south-1.amazonaws.comPrevent โ Use amazon-ecr-credential-helper or log in at the start of each job.
Q133 ECR push: name unknown: The repository with name 'app' does not exist in the registry
Beginner
name unknown: The repository with name 'app' does not exist in the registryLikely causes โ ECR requires the repository to be created first.
Diagnose โ aws ecr describe-repositories.
Fix โ aws ecr create-repository --repository-name app --image-scanning-configuration scanOnPush=true.
Prevent โ Create repos with Terraform.
Q134 toomanyrequests: You have reached your pull rate limit
Intermediate
toomanyrequests: You have reached your pull rate limitLikely causes โ Anonymous/free-tier Docker Hub limits per IP or account.
Diagnose โ Query the ratelimit-remaining header from the preview endpoint.
Fix โ Authenticate, use a paid org account/PAT, set up a pull-through cache and mirror base images.
Prevent โ Do not pull from Hub in production paths.
Q135 Push is very slow or fails with received unexpected HTTP status: 502 Bad Gateway or 413 Request Entity Too Large.
Intermediate
received unexpected HTTP status: 502 Bad Gateway or 413 Request Entity Too Large.Likely causes โ Reverse proxy in front of the registry limits body size or times out on big layers.
Diagnose โ Proxy logs; curl -v upload test.
Fix โ Nginx: client_max_body_size 0; proxy_request_buffering off; proxy_read_timeout 900; and required headers for registry.
Prevent โ Use registry-specific proxy config templates.
Q136 docker pull stuck on Waiting/Pulling fs layer then unexpected EOF.
Advanced
docker pull stuck on Waiting/Pulling fs layer then unexpected EOF.Likely causes โ Network instability, MTU issues, proxy resets, registry throttling.
Diagnose โ
docker pull -q img; echo $?
ping -M do -s 1472 registry-1.docker.io
journalctl -u docker | tailFix โ Lower MTU, reduce max-concurrent-downloads, use a mirror, retry.
Prevent โ Local pull-through cache.
Q137 Error response from daemon: Head "https://registry/v2/...": denied with correct credentials after switching credential helpers.
Intermediate
Error response from daemon: Head "https://registry/v2/...": denied with correct credentials after switching credential helpers.Likely causes โ Stale entry in the keychain/config.json, or credHelpers pointing to the wrong helper per registry.
Diagnose โ cat ~/.docker/config.json; docker-credential-<helper> list.
Fix โ docker logout reg && docker login reg; correct credHelpers.
Prevent โ One credential strategy per environment.
Q138 failed to authorize: failed to fetch oauth token: ... 401 from BuildKit while docker pull works.
Intermediate
failed to authorize: failed to fetch oauth token: ... 401 from BuildKit while docker pull works.Likely causes โ Builder uses different credentials (running as another user/sudo, remote builder), or the base image is private and no login in the build context.
Diagnose โ sudo -E docker buildx build; echo $HOME; which config.json is read.
Fix โ Log in as the same user running the build, set DOCKER_CONFIG, avoid sudo without -E.
Prevent โ Standardise runner user/credentials.
Q139 Pushed image appears on registry but nodes pull the old content with the same tag.
Advanced
Likely causes โ Node already has the tag cached and imagePullPolicy: IfNotPresent (or Compose didn't pull), or a CDN/mirror cache serves stale manifests.
Diagnose โ Compare docker images --digests on the node with the registry digest.
Fix โ Deploy by digest or unique tags; docker compose pull; set imagePullPolicy: Always only if you must keep mutable tags.
Prevent โ Immutable tags.
Q140 Harbor/Registry push: blob upload unknown or unknown blob mid-push.
Advanced
blob upload unknown or unknown blob mid-push.Likely causes โ Multiple registry replicas without shared storage/sticky sessions, storage backend (S3) eventual consistency, garbage collection running during push.
Diagnose โ Registry logs; check LB affinity and storage config.
Fix โ Use shared backend storage, sticky upload sessions or Redis for upload state, don't run GC while writes are active (or use read-only mode).
Prevent โ Schedule GC in maintenance windows.
Q141 docker manifest create error: ... is a manifest list / no such manifest.
Intermediate
docker manifest create error: ... is a manifest list / no such manifest.Likely causes โ Source images not pushed to the registry yet, or a source is itself a manifest list.
Diagnose โ docker manifest inspect reg/app:amd64.
Fix โ Push per-arch images first, then create; or use docker buildx imagetools create -t reg/app:1 reg/app:amd64 reg/app:arm64.
Prevent โ Prefer buildx --platform multi-arch builds.
Q142 Error response from daemon: error parsing HTTP 404 response body when pulling from a mirror.
Advanced
Error response from daemon: error parsing HTTP 404 response body when pulling from a mirror.Likely causes โ Mirror/proxy doesn't implement the registry v2 API at that path, or returns an HTML error page.
Diagnose โ curl -i https://mirror/v2/; look at response headers Docker-Distribution-Api-Version.
Fix โ Correct the mirror URL/path, fix proxy rewriting, use the proper pull-through endpoint.
Prevent โ Health-check the mirror with /v2/.
Q143 docker push fails: denied: requested access to the resource is denied
Beginner
docker push fails: denied: requested access to the resource is deniedLikely causes โ Image name lacks your namespace (myapp instead of user/myapp), not logged in, or no push rights.
Diagnose โ docker images; docker info | grep Username.
Fix โ docker tag myapp user/myapp:1.0 && docker push user/myapp:1.0 after login.
Prevent โ Tag with full registry paths in CI.
Q144 Image push works, but docker pull on another machine shows image operating system "windows" cannot be used on this platform.
Beginner
docker pull on another machine shows image operating system "windows" cannot be used on this platform.Likely causes โ Windows container image on a Linux host.
Diagnose โ docker manifest inspect img | grep os.
Fix โ Use a Linux image or run on Windows with Windows containers mode.
Prevent โ Label image OS/arch in docs.
Q145 Registry disk usage doesn't drop after deleting tags.
Intermediate
Likely causes โ Deleting tags/manifests doesn't delete blobs until garbage collection runs; deletes disabled (REGISTRY_STORAGE_DELETE_ENABLED).
Diagnose โ Check registry config for delete.enabled.
Fix โ
registry garbage-collect --delete-untagged /etc/docker/registry/config.ymlIn Harbor trigger GC from the UI/API.
Prevent โ Scheduled GC and retention rules.
Q146 Error: image not known when using podman pull alpine: short-name resolution enforced but cannot prompt without a TTY.
Intermediate
Error: image not known when using podman pull alpine: short-name resolution enforced but cannot prompt without a TTY.Likely causes โ Podman's short-name mode is enforcing and an unqualified name has several candidate registries in a non-interactive context.
Diagnose โ cat /etc/containers/registries.conf; podman info | grep -i search.
Fix โ Use fully qualified names (docker.io/library/alpine), or define [aliases] in registries.conf.d.
Prevent โ Always qualify image names in scripts.
Q147 docker login succeeds but pulls from the private registry still fail on Kubernetes with ImagePullBackOff.
Advanced
docker login succeeds but pulls from the private registry still fail on Kubernetes with ImagePullBackOff.Likely causes โ No imagePullSecrets, wrong namespace for the secret, expired cloud token, or node can't reach the registry.
Diagnose โ
kubectl describe pod p | tail -20
kubectl get secret regcred -o jsonpath='{.data.\.dockerconfigjson}' | base64 -d
crictl pull reg/app:tag # on the nodeFix โ Create the secret in the pod's namespace, link to ServiceAccount, fix network/credentials.
Prevent โ Use cloud credential providers.
Q148 failed to verify certificate: x509: certificate is valid for X, not registry.local
Intermediate
failed to verify certificate: x509: certificate is valid for X, not registry.localLikely causes โ Hostname used differs from the certificate SAN (IP address or alias).
Diagnose โ openssl s_client -connect host:443 | openssl x509 -noout -text | grep -A1 'Alternative'.
Fix โ Use the DNS name in the SAN, or re-issue the certificate with the correct SANs.
Prevent โ Issue certs with all hostnames and IPs.
Q149 Error: pull access denied after Docker Hub changed org/repo visibility or deleted a tag.
Beginner
Error: pull access denied after Docker Hub changed org/repo visibility or deleted a tag.Likely causes โ Publisher made the repo private or removed it.
Diagnose โ Browse the Hub page; try docker pull with login.
Fix โ Switch to an alternative or your mirrored copy.
Prevent โ Mirror third-party images you depend on.
Q150 Pull succeeds but docker run says Unable to find image ... locally when using DOCKER_HOST=ssh://.
Advanced
docker run says Unable to find image ... locally when using DOCKER_HOST=ssh://.Likely causes โ Pulled on the local daemon but running on the remote one (or the reverse); context mismatch.
Diagnose โ docker context show; docker info | grep Name.
Fix โ Use the same context for both commands (docker --context remote pull).
Prevent โ Show the current context in your shell prompt.
Resources, health checks, logging and restarts
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q151 Container restarts repeatedly: docker ps shows Restarting (1) 5 seconds ago.
Beginner
docker ps shows Restarting (1) 5 seconds ago.Likely causes โ App crashes on start (bad config, missing dependency, port conflict) with a restart policy re-launching it.
Diagnose โ
docker logs --tail 100 c
docker inspect -f '{{.State.ExitCode}} {{.State.Error}} {{.RestartCount}}' cFix โ Fix the startup error; temporarily docker update --restart no c to stop the loop while debugging.
Prevent โ Use on-failure:N for jobs and alert on restart counts.
Q152 OOMKilled: true and exit code 137.
Beginner
OOMKilled: true and exit code 137.Likely causes โ Process exceeded --memory, a leak, or a limit too small for the workload (JVM, page cache for tmpfs).
Diagnose โ
docker inspect -f '{{.State.OOMKilled}} {{.HostConfig.Memory}}' c
docker stats --no-stream c
dmesg -T | grep -i 'memory cgroup out of memory'Fix โ Raise the limit, tune the runtime (heap -Xmx or MaxRAMPercentage), fix leaks.
Prevent โ Load-test to size limits; alert at 90% of the limit.
Q153 Container is unhealthy but the app works when tested manually.
Intermediate
unhealthy but the app works when tested manually.Likely causes โ Healthcheck command missing in the image (curl: not found), wrong port/path, too-short timeout, runs as a different user, or checks a dependency that's down.
Diagnose โ
docker inspect -f '{{json .State.Health}}' c | jq
docker exec c sh -c 'curl -fsS http://localhost:8080/healthz; echo $?'Fix โ Install the needed tool or use the app binary, fix URL, raise timeout/start_period.
Prevent โ Test the health command in CI.
Q154 docker stats shows 100%+ CPU and the container is slow.
Intermediate
docker stats shows 100%+ CPU and the container is slow.Likely causes โ Multi-core usage above 100% is normal (200% = two cores); with --cpus limit the app is throttled.
Diagnose โ
docker exec c cat /sys/fs/cgroup/cpu.stat
docker exec c top -b -n1 | head -15Fix โ Increase --cpus, profile the hot path, scale out.
Prevent โ Track nr_throttled metrics.
Q155 docker logs is slow or docker logs -f hangs on a container with huge logs.
Intermediate
docker logs is slow or docker logs -f hangs on a container with huge logs.Likely causes โ Large json-file log being read from the start.
Diagnose โ ls -lh /var/lib/docker/containers/<id>/<id>-json.log.
Fix โ docker logs --tail 200 -f c, --since 10m; rotate logs.
Prevent โ Rotation and shipping logs to a backend.
Q156 Error response from daemon: configured logging driver does not support reading when running docker logs.
Intermediate
Error response from daemon: configured logging driver does not support reading when running docker logs.Likely causes โ Driver such as syslog, gelf, fluentd or awslogs without dual logging support in that engine/plugin setup.
Diagnose โ docker inspect -f '{{.HostConfig.LogConfig.Type}}' c.
Fix โ Read logs in the backend, or use local/json-file driver; Docker 20.10+ dual logging usually caches for most drivers.
Prevent โ Choose a driver with local cache (or run a collector sidecar).
Q157 Application hangs and logs stop: log driver blocking (fluentd: connection refused).
Advanced
fluentd: connection refused).Likely causes โ Default blocking log mode: when the remote log endpoint is unavailable, writes to stdout block the app.
Diagnose โ docker inspect -f '{{.HostConfig.LogConfig}}' c; strace -p <pid> shows write(1, ...) blocked; check collector.
Fix โ --log-opt mode=non-blocking --log-opt max-buffer-size=4m; restore the collector.
Prevent โ Use a local collector tailing files rather than direct network drivers.
Q158 Container killed by the OOM killer but docker stats never showed high memory.
Advanced
docker stats never showed high memory.Likely causes โ Short spikes between sampling intervals, kernel memory/tmpfs counted in the cgroup, or sub-process memory.
Diagnose โ
cat /sys/fs/cgroup/system.slice/docker-<id>.scope/memory.events
cat .../memory.peak
dmesg -T | grep -B2 -A10 'Memory cgroup out of memory'Fix โ Raise the limit by the observed memory.peak, reduce spikes (batch size, parallelism).
Prevent โ Alert on memory.events oom_kill counters.
Q159 docker update --memory fails: Cannot update container ... Memory limit should be smaller than already set memoryswap limit.
Intermediate
docker update --memory fails: Cannot update container ... Memory limit should be smaller than already set memoryswap limit.Likely causes โ Existing memory-swap is lower than the new memory limit.
Diagnose โ docker inspect -f '{{.HostConfig.MemorySwap}}' c.
Fix โ docker update --memory 1g --memory-swap 1g c (set both).
Prevent โ Set both values together.
Q160 Limits seem ignored: WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
Advanced
WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.Likely causes โ Swap accounting disabled in the kernel (common on Debian/Ubuntu defaults).
Diagnose โ docker info | grep -i swap; cat /proc/cmdline.
Fix โ Add cgroup_enable=memory swapaccount=1 to GRUB (cgroup v1), or use cgroup v2 where it works; update-grub and reboot.
Prevent โ Standardise kernel parameters in the host image.
Q161 Restart policy unless-stopped container comes back after docker stop + daemon restart.
Intermediate
unless-stopped container comes back after docker stop + daemon restart.Likely causes โ It was stopped by something other than an explicit docker stop (e.g. Compose down, kill), or always was used (restarts regardless on daemon start).
Diagnose โ docker inspect -f '{{.HostConfig.RestartPolicy.Name}}' c.
Fix โ Use unless-stopped or no and stop via docker stop.
Prevent โ Know the semantic difference between always and unless-stopped.
Q162 docker events shows health_status: unhealthy flapping every minute.
Intermediate
docker events shows health_status: unhealthy flapping every minute.Likely causes โ Health command timing out under load (timeout 1s default 30s interval depending on setting), GC pauses, dependency checks too strict.
Diagnose โ docker inspect -f '{{range .State.Health.Log}}{{.Start}} {{.ExitCode}} {{.Output}}{{end}}' c.
Fix โ Lighter health endpoint, larger timeout/retries, separate liveness from dependency checks.
Prevent โ Make health endpoints cheap and cached.
Q163 Java container ignores memory limit and uses host memory (old JDK): OutOfMemoryError or killed.
Advanced
OutOfMemoryError or killed.Likely causes โ Older JDK (<8u191) doesn't read cgroup limits, so default heap is 25% of host RAM.
Diagnose โ docker exec c java -XX:+PrintFlagsFinal -version | grep -E 'MaxHeapSize|UseContainerSupport'.
Fix โ Upgrade JDK (11+/17/21), set -XX:MaxRAMPercentage=70, or explicit -Xmx.
Prevent โ Use current LTS base images.
Q164 Node.js container OOM despite --memory 512m: V8 heap default is larger.
Intermediate
--memory 512m: V8 heap default is larger.Likely causes โ V8 sizes heap from available memory/limits and Buffers live outside heap; default old-space can exceed the limit.
Diagnose โ docker exec c node -e "console.log(v8.getHeapStatistics().heap_size_limit/1048576)".
Fix โ NODE_OPTIONS=--max-old-space-size=384 (about 75% of limit), watch RSS.
Prevent โ Set heap flags together with limits.
Q165 Container can't create threads/processes: fork: retry: Resource temporarily unavailable.
Advanced
fork: retry: Resource temporarily unavailable.Likely causes โ --pids-limit reached, or host/user nproc ulimit, or threads leak.
Diagnose โ
docker inspect -f '{{.HostConfig.PidsLimit}}' c
docker exec c sh -c 'ls /proc | grep -c "^[0-9]"'
cat /sys/fs/cgroup/.../pids.currentFix โ Raise limit, fix leaking process/thread creation, reap zombies (--init).
Prevent โ Alert on pids.current.
Q166 too many open files inside a container.
Beginner
too many open files inside a container.Likely causes โ Low nofile ulimit, FD leak, or host fs.file-max/inotify limits.
Diagnose โ
docker exec c sh -c 'ulimit -n'
docker exec c ls /proc/1/fd | wc -l
sysctl fs.inotify.max_user_instancesFix โ --ulimit nofile=65536:65536; raise inotify sysctls on host for watchers (ENOSPC on inotify); fix leaks.
Prevent โ Standard ulimits in daemon.json default-ulimits.
Q167 Elasticsearch container exits: max virtual memory areas vm.max_map_count [65530] is too low.
Beginner
max virtual memory areas vm.max_map_count [65530] is too low.Likely causes โ Host kernel setting too low (containers share it).
Diagnose โ sysctl vm.max_map_count.
Fix โ sudo sysctl -w vm.max_map_count=262144; persist in /etc/sysctl.d/99-es.conf.
Prevent โ Provision sysctls in host config.
Q168 Container clock skew breaks JWT/TLS validation (token used before issued).
Intermediate
token used before issued).Likely causes โ Host or Docker Desktop VM clock drift (after sleep).
Diagnose โ docker run --rm busybox date -u; date -u.
Fix โ Fix NTP/chrony on the host; restart Docker Desktop to resync VM time.
Prevent โ Time sync monitoring.
Q169 docker stop hangs then kills; app data corrupted because shutdown never completed.
Advanced
docker stop hangs then kills; app data corrupted because shutdown never completed.Likely causes โ Shutdown takes longer than 10 s default stop timeout.
Diagnose โ Time docker stop c; look at app shutdown logs.
Fix โ docker stop -t 60, stop_grace_period: 60s, handle SIGTERM, correct STOPSIGNAL (for example SIGINT/SIGQUIT for some servers).
Prevent โ Test graceful shutdown.
Q170 Container's DNS or hostname weirdness after docker update/network change: docker update doesn't change network.
Beginner
docker update/network change: docker update doesn't change network.Likely causes โ docker update only changes resources and restart policy, not networks, ports or env.
Diagnose โ docker update --help.
Fix โ docker network connect/disconnect for networks; recreate the container for ports/env.
Prevent โ Treat containers as immutable; change config in Compose and recreate.
Q171 Disk I/O wait high on the host and all containers slow.
Advanced
Likely causes โ One noisy container (logging, DB, backup), overlay copy-up on huge files, or small volume IOPS.
Diagnose โ
iostat -x 1
sudo iotop -oPa
docker stats --no-stream
cat /sys/fs/cgroup/system.slice/docker-<id>.scope/io.statFix โ Throttle (--device-write-bps), move hot paths to dedicated volumes, increase IOPS.
Prevent โ Per-container IO metrics and limits.
Q172 Memory not released after load; docker stats stays high.
Advanced
docker stats stays high.Likely causes โ Allocators (glibc arenas, JVM) hold memory, page cache is included, or a real leak.
Diagnose โ docker exec c cat /sys/fs/cgroup/memory.stat | head -20 (anon vs file); heap dumps.
Fix โ Tune allocator (MALLOC_ARENA_MAX=2, jemalloc), cap heap; fix the leak if anon grows steadily.
Prevent โ Soak tests with memory graphs.
Q173 docker compose up says services are unhealthy and dependent services never start: dependency failed to start: container db is unhealthy.
Intermediate
docker compose up says services are unhealthy and dependent services never start: dependency failed to start: container db is unhealthy.Likely causes โ Health check fails (wrong credentials, wrong command, slow initialization such as a DB restore).
Diagnose โ
docker compose ps
docker compose logs db
docker inspect --format '{{json .State.Health}}' $(docker compose ps -q db) | jqFix โ Correct the check (pg_isready -U $POSTGRES_USER), add start_period, fix env.
Prevent โ Test health commands manually first.
Q174 Live logs are missing lines or delayed with local driver: docker logs --since shows fewer lines than expected after rotation.
Advanced
local driver: docker logs --since shows fewer lines than expected after rotation.Likely causes โ Rotation (max-size, max-file) discarded older entries; small buffers with non-blocking mode drop messages (max-buffer-size exceeded).
Diagnose โ Check log-opts; look for dropped messages in journalctl -u docker.
Fix โ Raise sizes, ship logs externally before rotation, use blocking mode where loss is unacceptable.
Prevent โ Size rotation for peak throughput, centralize logs.
Q175 Container's CPU usage inside top differs from docker stats.
Advanced
top differs from docker stats.Likely causes โ top inside shows host-level /proc/stat data (no lxcfs), while docker stats reads cgroup accounting.
Diagnose โ Compare docker stats with cat /sys/fs/cgroup/cpu.stat deltas.
Fix โ Trust cgroup metrics (cAdvisor); use nproc/cgroup files for in-app sizing.
Prevent โ Monitoring based on cgroup metrics, not in-container top.
Security, rootless, Podman and containerd
๐ฅ Learn this hands-on with DevOps Shack โ YouTube @devopsshack ยท Hindi @shackverse ยท Courses at devopsshack.com
Q176 Rootless Docker: dockerd-rootless.sh fails with newuidmap: write to uid_map failed: Operation not permitted
Intermediate
dockerd-rootless.sh fails with newuidmap: write to uid_map failed: Operation not permittedLikely causes โ Missing uidmap package/setuid bit or no subuid/subgid ranges for the user.
Diagnose โ
grep $USER /etc/subuid /etc/subgid
ls -l $(which newuidmap)
sysctl kernel.unprivileged_userns_clone user.max_user_namespacesFix โ Install uidmap, add ranges (usermod --add-subuids 100000-165535 --add-subgids 100000-165535 $USER), enable user namespaces.
Prevent โ Include these in the base image.
Q177 Rootless: rootlesskit: failed to ... listen tcp 0.0.0.0:80: bind: permission denied
Beginner
rootlesskit: failed to ... listen tcp 0.0.0.0:80: bind: permission deniedLikely causes โ Unprivileged users can't bind ports <1024.
Diagnose โ sysctl net.ipv4.ip_unprivileged_port_start.
Fix โ sudo sysctl -w net.ipv4.ip_unprivileged_port_start=80, or publish a high port and redirect with firewall/proxy.
Prevent โ Use 8080/8443 internally.
Q178 Rootless Docker stops when you log out of SSH.
Beginner
Likely causes โ The user systemd instance ends at logout.
Diagnose โ loginctl show-user $USER | grep Linger.
Fix โ sudo loginctl enable-linger $USER.
Prevent โ Make it part of provisioning.
Q179 Rootless containers: Error: ... cannot set up namespace using "/usr/bin/newuidmap": should have setuid or have filecaps setuid (Podman).
Intermediate
Error: ... cannot set up namespace using "/usr/bin/newuidmap": should have setuid or have filecaps setuid (Podman).Likely causes โ newuidmap/newgidmap lack setuid or file capabilities (e.g. minimal image or container-in-container).
Diagnose โ ls -l /usr/bin/newuidmap; getcap /usr/bin/newuidmap.
Fix โ chmod u+s or setcap cap_setuid+ep, reinstall shadow-utils/uidmap.
Prevent โ Install proper packages, not manual copies.
Q180 Podman: Error: short-name "nginx" did not resolve to an alias and no unqualified-search registries are defined in "/etc/containers/registries.conf"
Beginner
Error: short-name "nginx" did not resolve to an alias and no unqualified-search registries are defined in "/etc/containers/registries.conf"Likely causes โ No unqualified-search-registries configured.
Diagnose โ grep -v '^#' /etc/containers/registries.conf.
Fix โ Use docker.io/library/nginx, or add unqualified-search-registries = ["docker.io"].
Prevent โ Fully qualified names in scripts.
Q181 Podman rootless: Error: cannot find newuidmap / ping fails inside container: ping: permission denied (are you root?).
Intermediate
Error: cannot find newuidmap / ping fails inside container: ping: permission denied (are you root?).Likely causes โ Ping needs raw sockets; unprivileged ICMP range excludes the user's GID.
Diagnose โ sysctl net.ipv4.ping_group_range.
Fix โ sudo sysctl -w net.ipv4.ping_group_range="0 2147483647".
Prevent โ Persist in sysctl.d.
Q182 Rootless Podman volumes show wrong owner: files appear owned by a huge UID (e.g. 100999) on the host.
Advanced
Likely causes โ User namespace mapping: container UID N maps to subuid base + N โ 1 on host.
Diagnose โ podman unshare ls -ln dir; cat /proc/self/uid_map.
Fix โ Use podman unshare chown, --userns=keep-id, or :U volume option.
Prevent โ Plan UID mapping for shared directories.
Q183 docker run --privileged container breaks host networking after it runs iptables -F.
Advanced
docker run --privileged container breaks host networking after it runs iptables -F.Likely causes โ Privileged container (or NET_ADMIN with host network) altered host firewall rules.
Diagnose โ docker inspect -f '{{.HostConfig.Privileged}} {{.HostConfig.NetworkMode}}' c; iptables -S.
Fix โ Restart Docker to recreate chains; remove privileges and host networking.
Prevent โ Policy blocking privileged containers, --cap-drop ALL.
Q184 Trivy/Scout reports a CVE in a package your app does not use.
Intermediate
Likely causes โ Package present in the base image; may be unreachable or unfixed.
Diagnose โ
trivy image --severity HIGH,CRITICAL --format json app | jq '.Results[].Vulnerabilities[]? | {PkgName,InstalledVersion,FixedVersion}'
docker run --rm --entrypoint sh app -c 'apt list --installed 2>/dev/null | head'Fix โ Remove the package, switch to slimmer base, update base, or document VEX/ignore with expiry.
Prevent โ Minimal bases; scan on a schedule.
Q185 docker scan/docker scout fails: unauthorized or failed to resolve image.
Beginner
docker scan/docker scout fails: unauthorized or failed to resolve image.Likely causes โ Not logged in to Docker Hub, docker scan removed (replaced by Scout), or the image is only in a registry the tool can't reach.
Diagnose โ docker scout version; docker login.
Fix โ Use docker scout cves image after login, or trivy image.
Prevent โ Standardize on one scanner in CI.
Q186 permission denied when container tries to write with --read-only: Read-only file system.
Intermediate
permission denied when container tries to write with --read-only: Read-only file system.Likely causes โ App writes to a path not mounted writable (/tmp, /var/run, cache dirs).
Diagnose โ docker run --read-only ... then strace -f -e trace=openat,mkdir or app logs naming the path.
Fix โ Add --tmpfs /tmp --tmpfs /run or volumes for the specific paths.
Prevent โ Test with read-only root in CI.
Q187 operation not permitted running ip link add or sysctl -w inside a container.
Intermediate
operation not permitted running ip link add or sysctl -w inside a container.Likely causes โ Missing capability (NET_ADMIN/SYS_ADMIN), or sysctl not namespaced.
Diagnose โ docker exec c capsh --print (if available) or grep Cap /proc/1/status.
Fix โ --cap-add NET_ADMIN for networking tools; set namespaced sysctls with --sysctl net.ipv4.ip_forward=1; host-wide sysctls must be set on the host.
Prevent โ Add only needed capabilities.
Q188 ptrace: Operation not permitted when using strace/gdb in a container.
Intermediate
ptrace: Operation not permitted when using strace/gdb in a container.Likely causes โ Default seccomp/capabilities block ptrace.
Diagnose โ docker inspect -f '{{.HostConfig.SecurityOpt}} {{.HostConfig.CapAdd}}' c.
Fix โ Debug-only: --cap-add SYS_PTRACE (and --security-opt seccomp=unconfined on older kernels).
Prevent โ Use ephemeral debug containers instead of loosening prod.
Q189 AppArmor denial: apparmor="DENIED" operation="mount" in dmesg when starting a container.
Intermediate
apparmor="DENIED" operation="mount" in dmesg when starting a container.Likely causes โ The default docker-default profile blocks the operation (mount, ptrace, etc.).
Diagnose โ dmesg | grep apparmor; aa-status.
Fix โ Write a custom profile with the needed rule (--security-opt apparmor=custom), or avoid the operation. Not unconfined unless sandboxed.
Prevent โ Develop apps to work under default profiles.
Q190 SELinux: avc: denied { read } for ... scontext=system_u:system_r:container_t:s0:c1,c2 tcontext=...:user_home_t
Advanced
avc: denied { read } for ... scontext=system_u:system_r:container_t:s0:c1,c2 tcontext=...:user_home_tLikely causes โ Mounted a host directory without a container label.
Diagnose โ sudo ausearch -m avc -ts recent | audit2why.
Fix โ :z/:Z on the volume, or label container_file_t; avoid --security-opt label=disable outside tests.
Prevent โ Keep data under labeled dirs such as /srv.
Q191 containerd: failed to pull and unpack image: failed to resolve reference ... x509 / http: server gave HTTP response to HTTPS client
Intermediate
failed to pull and unpack image: failed to resolve reference ... x509 / http: server gave HTTP response to HTTPS clientLikely causes โ containerd isn't using Docker's certs.d; the registry TLS/CA isn't configured for containerd.
Diagnose โ crictl pull reg/app:tag; grep -A5 registry /etc/containerd/config.toml.
Fix โ Configure config_path = "/etc/containerd/certs.d" and hosts.toml with CA or skip_verify (test only); systemctl restart containerd.
Prevent โ Provision registry config for containerd with config management.
Q192 crictl says unable to determine runtime API version: ... connection refused
Beginner
crictl says unable to determine runtime API version: ... connection refusedLikely causes โ crictl endpoint not set or containerd not running.
Diagnose โ cat /etc/crictl.yaml; systemctl status containerd; ls /run/containerd/containerd.sock.
Fix โ crictl config --set runtime-endpoint=unix:///run/containerd/containerd.sock and start containerd.
Prevent โ Ship /etc/crictl.yaml on nodes.
Q193 ctr images ls shows nothing though Kubernetes runs pods.
Beginner
ctr images ls shows nothing though Kubernetes runs pods.Likely causes โ Wrong containerd namespace; Kubernetes uses k8s.io.
Diagnose โ ctr namespaces ls.
Fix โ ctr -n k8s.io images ls or crictl images.
Prevent โ Prefer crictl on Kubernetes nodes.
Q194 containerd: failed to create shim task: OCI runtime create failed: ... expected cgroupsPath to be of format "slice:prefix:name"
Advanced
failed to create shim task: OCI runtime create failed: ... expected cgroupsPath to be of format "slice:prefix:name"Likely causes โ Mismatch: kubelet uses systemd cgroup driver while containerd/runc uses cgroupfs (or vice versa).
Diagnose โ
grep -n SystemdCgroup /etc/containerd/config.toml
grep cgroupDriver /var/lib/kubelet/config.yamlFix โ Set SystemdCgroup = true under [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] (or the v3 config equivalent) and cgroupDriver: systemd; restart both.
Prevent โ Align drivers when bootstrapping nodes (kubeadm defaults).
Q195 Podman container cannot reach another by name: Temporary failure in name resolution on the default network.
Intermediate
Temporary failure in name resolution on the default network.Likely causes โ Default podman network has DNS disabled; name resolution needs a user-created network with aardvark-dns.
Diagnose โ podman network inspect podman | jq '.[0].dns_enabled'.
Fix โ podman network create appnet and use --network appnet.
Prevent โ Always create named networks.
Q196 Podman: Error: creating container storage: the container name "web" is already in use
Beginner
Error: creating container storage: the container name "web" is already in useLikely causes โ Previous container (possibly stopped) holds the name.
Diagnose โ podman ps -a --filter name=web.
Fix โ podman rm -f web; use --replace.
Prevent โ --replace or --rm in scripts.
Q197 podman-compose/docker compose against Podman socket fails: Cannot connect to the Docker daemon at unix:///var/run/docker.sock.
Intermediate
podman-compose/docker compose against Podman socket fails: Cannot connect to the Docker daemon at unix:///var/run/docker.sock.Likely causes โ Podman API socket isn't enabled or DOCKER_HOST isn't set.
Diagnose โ systemctl --user status podman.socket; ls $XDG_RUNTIME_DIR/podman/podman.sock.
Fix โ
systemctl --user enable --now podman.socket
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sockPrevent โ Set DOCKER_HOST in the shell profile.
Q198 Image runs fine as root but fails as non-root (EACCES creating /app/.cache or /.npm).
Beginner
EACCES creating /app/.cache or /.npm).Likely causes โ Home/cache directories not writable by the non-root UID; no passwd entry for arbitrary UIDs.
Diagnose โ docker run --user 10001 --rm image sh -c 'id; echo $HOME; touch $HOME/x'.
Fix โ chown dirs at build, set HOME=/tmp or a writable path, npm_config_cache=/tmp/.npm.
Prevent โ Test with the production user and read-only FS.
Q199 Docker socket proxy breaks Traefik/Portainer: 403 Forbidden from the proxy.
Intermediate
403 Forbidden from the proxy.Likely causes โ The socket proxy denies API sections by default (CONTAINERS, NETWORKS, etc.).
Diagnose โ Proxy logs; compare required API calls.
Fix โ Enable only needed env vars (CONTAINERS=1, NETWORKS=1, SERVICES=1), keep POST=0.
Prevent โ Document the minimal permission set per tool.
Q200 Suspected container escape: unknown process on the host tied to a container. How do you investigate?
Advanced
Likely causes โ Privileged container, mounted socket, vulnerable runtime (runc/kernel CVE), or compromised credentials; or a miner running inside the container's namespaces.
Diagnose โ
ps -eo pid,ppid,user,cmd --forest
docker inspect -f '{{.Id}} {{.State.Pid}}' $(docker ps -q)
ls -l /proc/<pid>/ns /proc/<pid>/exe
nsenter -t <pid> -n ss -tnp
docker diff <c>; ausearch -k dockerFix โ Isolate the host (network quarantine), preserve evidence (docker export, memory/disk snapshot), then rebuild host and containers from clean images and rotate all secrets that were reachable.
Prevent โ Patch runc/kernel, drop privileges, no socket mounts, runtime detection (Falco), and egress filtering.