Docker with AI
Build, debug, and harden Docker with AI — Dockerfiles, image builds, registries, networking, volumes, the daemon, and container runtime errors.
Prompts
- Beginner
Docker Build Failure Diagnosis Prompt
Diagnose a failing `docker build` from the error output and Dockerfile, pinpoint the breaking instruction (cache, COPY path, network, platform, dependency), and give a tested fix.
- Claude
- ChatGPT
Open prompt - Advanced
Multi-Arch Image Build with Buildx Design Prompt
Design a buildx multi-arch (amd64/arm64) image pipeline with the right builder, cross-compilation strategy, cache export, and a single multi-platform manifest pushed to a registry.
- Claude
- ChatGPT
Open prompt - Intermediate
Docker Compose Networking & Service Discovery Debug Prompt
Troubleshoot Compose services that cannot reach each other, fail DNS resolution, hit port conflicts, or start before dependencies are ready, and produce a corrected compose file.
- Claude
- ChatGPT
Open prompt - Intermediate
Crashing Container Exit-Code & Log Debug Prompt
Diagnose why a container exits immediately, restart-loops, or gets OOM-killed by reading its exit code, logs, and inspect output, then produce a ranked fix list.
- Claude
- ChatGPT
Open prompt - Intermediate
Container Healthcheck & ENTRYPOINT/CMD Design Prompt
Design a correct HEALTHCHECK and fix ENTRYPOINT/CMD so the container starts as PID 1, handles signals, reports real readiness, and shuts down gracefully.
- Claude
- ChatGPT
Open prompt - Advanced
Container Image Security & CVE Triage Prompt
Review a built image and scanner report to triage CVEs, harden the Dockerfile, drop the attack surface, and decide what to fix now versus accept with justification.
- Claude
- ChatGPT
Open prompt - Intermediate
Image Size Reduction Layer Audit Prompt
Audit an oversized image layer-by-layer to find what is taking space (caches, secrets, build artifacts, fat base) and produce concrete instructions to shrink it.
- Claude
- ChatGPT
- Dive
Open prompt - Intermediate
Volume Mount & Permission Troubleshooting Prompt
Fix Docker volume problems: permission-denied on bind mounts, UID/GID mismatch between host and container, data not persisting, or a named volume masking image content.
- Claude
- ChatGPT
Open prompt - Intermediate
Multi-Stage Dockerfile Size & Build-Cache Optimization Prompt
Refactor a bloated Dockerfile into a lean multi-stage build that maximizes layer cache hits, shrinks the final image, and speeds up CI rebuilds without breaking the runtime.
- Claude
- ChatGPT
Open prompt
Guides
- · 9 min read
Docker Error Guide: 'conflict: unable to remove repository reference' Image Removal Failures
Fix Docker 'conflict: unable to remove image': clear containers using the image, handle multiple tags and child images, and force-remove references safely.
Read guide - · 9 min read
Docker Error Guide: 'context canceled' Build and Pull Cancellation Failures
Fix Docker 'context canceled': diagnose timeouts, interrupted builds, daemon restarts, and dropped connections that abort BuildKit and pull operations.
Read guide - · 9 min read
Docker Error Guide: 'device or resource busy' Volume and Mount Removal Failures
Fix Docker 'device or resource busy' on volume rm: find containers still using the volume, clear stale mounts, and release busy bind targets safely.
Read guide - · 9 min read
Docker Error Guide: 'exec /entrypoint.sh: no such file or directory' Entrypoint Startup Failures
Fix Docker 'exec /entrypoint.sh: no such file or directory': repair CRLF line endings, missing shells, wrong arch, and unset executable bits on entrypoints.
Read guide - · 9 min read
Docker Error Guide: 'failed to create shim task' Containerd Runtime Startup Failures
Fix Docker 'failed to create shim task': repair runc/containerd-shim issues, cgroup v2 misconfig, OCI runtime errors, and missing kernel features.
Read guide - · 9 min read
Docker Error Guide: 'failed to set up container networking' Bridge and IP Allocation Failures
Fix Docker 'failed to set up container networking': repair the docker0 bridge, exhausted IP pools, missing iptables/nftables rules, and stale network state.
Read guide - · 9 min read
Docker Error Guide: 'layers from manifest don't match image configuration' Pull Validation Failures
Fix Docker 'layers from manifest don't match image configuration': clear corrupted pull caches, registry mirror mismatches, and broken multi-arch manifests.
Read guide - · 9 min read
Docker Error Guide: 'max depth exceeded' Image Layer Limit Failures
Fix Docker 'max depth exceeded': flatten oversized layer stacks, refactor RUN-heavy Dockerfiles, and rebuild base images that exceed the 125-layer limit.
Read guide - · 9 min read
Docker Error Guide: 'toomanyrequests' Docker Hub Pull Rate Limit Failures
Fix Docker 'toomanyrequests' rate limit: authenticate pulls, use a pull-through mirror, pin digests, and stop anonymous Docker Hub throttling in CI.
Read guide - · 9 min read
Docker Error Guide: 'Cannot connect to the Docker daemon' Daemon Connection Failures
Fix 'Cannot connect to the Docker daemon at unix:///var/run/docker.sock' by starting dockerd, fixing DOCKER_HOST, daemon.json, and the active context.
Read guide - · 9 min read
Docker Error Guide: 'client version is too new' API Version Mismatch
Fix Docker's client version too new error: pin DOCKER_API_VERSION, upgrade the daemon to match the CLI, or align engine and CLI versions in CI and remote hosts.
Read guide - · 9 min read
Docker Error Guide: 'COPY failed: file not found in build context' Build Context Errors
Fix 'COPY failed: file not found in build context' in Docker: correct context-relative paths, .dockerignore exclusions, wrong build context, case sensitivity, and COPY --from.
Read guide - · 9 min read
Docker Error Guide: 'Error initializing network controller' Daemon Startup Failure
Fix dockerd 'Error initializing network controller' bridge and NAT failures: repair iptables, firewalld, the docker0 bridge, ip_forward, and corrupt network state.
Read guide - · 9 min read
Docker Error Guide: 'executable file not found in $PATH' Entrypoint Failures
Fix 'executable file not found in $PATH' in Docker by installing the binary, using absolute paths, the exec vs shell form, or a multi-stage COPY.
Read guide - · 9 min read
Docker Error Guide: 'failed to mount overlay: invalid argument' overlay2 Storage Failures
Fix 'failed to mount overlay: invalid argument' in Docker: resolve missing d_type on xfs, unsupported kernels, symlink-depth limits, corrupted overlay2, and driver mismatches.
Read guide - · 9 min read
Docker Error Guide: 'failed to register layer' Storage and Layer Extraction Failures
Fix Docker 'failed to register layer': free disk space and inodes, prune overlay2, repair userns-remap chown errors, and re-pull corrupted layers. Diagnose with system df.
Read guide - · 9 min read
Docker Error Guide: 'failed to solve with frontend dockerfile.v0' BuildKit Build Failures
Fix 'failed to solve with frontend dockerfile.v0' in Docker BuildKit: resolve Dockerfile syntax errors, missing files, unresolved ARGs, base images, and cache key failures.
Read guide - · 9 min read
Docker Error Guide: 'invalid mount config for type "bind"' Bind Mount Failures
Fix Docker's invalid mount config for type bind error: create missing host paths, use absolute paths, enable Desktop file sharing, and set SELinux labels.
Read guide - · 9 min read
Docker Error Guide: 'manifest unknown' Missing Tag or Digest
Fix Docker 'manifest for <image>:<tag> not found: manifest unknown': use a tag that exists, push the missing tag, check digests, and inspect the registry with manifest inspect.
Read guide - · 9 min read
Docker Error Guide: 'no matching manifest for linux/amd64 in the manifest list entries' Platform Mismatch
Fix Docker 'no matching manifest for linux/amd64': pull with --platform, build multi-arch images with buildx, inspect available platforms, and enable qemu emulation.
Read guide - · 9 min read
Docker Error Guide: 'no space left on device' Docker Disk Exhaustion
Fix 'no space left on device' in Docker: reclaim disk from images, containers, volumes, and build cache, free inodes, rotate logs, and relocate or grow /var/lib/docker.
Read guide - · 9 min read
Docker Error Guide: 'OCI runtime create failed: runc create failed' Container Start Failures
Fix 'OCI runtime create failed: runc create failed' by reading the runc error suffix — missing binary, permission denied, no such file, or bad mount.
Read guide - · 9 min read
Docker Error Guide: 'OOMKilled' Exit Code 137 Out-of-Memory Container Kills
Fix Docker OOMKilled and exit code 137: raise memory limits, make the JVM and Node cgroup-aware, find leaks, and read dmesg to confirm the kernel OOM kill.
Read guide - · 9 min read
Docker Error Guide: 'permission denied while trying to connect to the Docker daemon socket' Access Errors
Fix 'Got permission denied' on /var/run/docker.sock by adding your user to the docker group, re-logging in, or switching to rootless Docker safely.
Read guide - · 9 min read
Docker Error Guide: 'port is already allocated' Container Port Bind Failures
Fix Docker 'port is already allocated' and 'address already in use' bind errors: free conflicting containers, host processes, stale docker-proxy, and remap ports.
Read guide - · 9 min read
Docker Error Guide: 'pull access denied for <image>, repository does not exist or may require docker login' Registry Auth Failures
Fix Docker 'pull access denied... requested access to the resource is denied': run docker login, correct the namespace, check ~/.docker/config.json, and verify the image exists.
Read guide - · 9 min read
Docker Error Guide: 'Temporary failure in name resolution' Container DNS Failures
Fix Docker 'Temporary failure in name resolution' and 127.0.0.11 DNS errors: repair host resolv.conf, set daemon DNS, use user-defined networks, and handle IPv6.
Read guide - · 9 min read
Docker Error Guide: 'net/http: TLS handshake timeout' Registry Pull Failures
Fix Docker 'net/http: TLS handshake timeout' on registry pulls: configure the dockerd proxy, lower docker0 MTU, fix IPv6 blackholes, and work around rate limits.
Read guide - · 9 min read
Docker Error Guide: 'x509: certificate signed by unknown authority' Registry TLS Failures
Fix Docker's x509 certificate signed by unknown authority error: install the registry CA in /etc/docker/certs.d, update the trust store, and restart dockerd.
Read guide