Skip to content

Docker and registry ​

Encyclopedia home · Search machine-readable catalog

The broken snippets are deliberate negative examples. Use only in an isolated fixture repository or lab.

F073 ​

COPY file outside build context

Symptom. failed to calculate checksum: not found.

Root cause. Dockerfile copies a root-level input absent from service context.

Broken example

bash
docker build -f services/web/Dockerfile services/web

Corrected example

bash
docker build -f services/web/Dockerfile .

Verification. Adjust COPY sources for chosen context and inspect .dockerignore.

Correction validation syntax-validated.

F074 ​

Build excludes needful lockfile

Symptom. uv.lock not found in build context.

Root cause. A broad pattern hides required dependencies.

Broken example

dockerignore
*.lock

Corrected example

dockerignore
*.lock
!uv.lock

Verification. Inspect BuildKit logs and verify intended exception.

Correction validation untested.

F075 ​

Smoke test tries service too early

Symptom. connection refused immediately after docker run.

Root cause. Process start is not readiness.

Broken example

bash
curl -fsS http://localhost:18000/healthz

Corrected example

bash
curl -fsS --retry 8 --retry-connrefused --retry-delay 1 http://localhost:18000/healthz

Verification. Poll readiness with a bounded retry policy.

Correction validation syntax-validated.

F076 ​

Container listens on loopback internally

Symptom. host curl connection reset.

Root cause. Published Docker port cannot reach process bound to container loopback.

Broken example

bash
uvicorn app:app --host 127.0.0.1 --port 8000

Corrected example

bash
uvicorn app:app --host 0.0.0.0 --port 8000

Verification. Bind all interfaces in isolated container and publish loopback on host as needed.

Correction validation syntax-validated.

F077 ​

Image name contains uppercase characters

Symptom. invalid reference format.

Root cause. Repository components must be lowercase.

Broken example

bash
docker tag web:ci "ghcr.io/$OWNER/Web:ci"

Corrected example

bash
image_repo=$(printf 'ghcr.io/%s/web' "$OWNER" | tr '[:upper:]' '[:lower:]')
docker tag web:ci "$image_repo:ci"

Verification. Validate final printed image reference.

Correction validation syntax-validated.

F078 ​

Push targets missing local tag

Symptom. An image does not exist locally with the tag.

Root cause. Building one name doesn't create a second local reference.

Broken example

bash
docker push "$IMAGE:sha-$GITHUB_SHA"

Corrected example

bash
docker tag web:ci "$IMAGE:sha-$GITHUB_SHA"
docker push "$IMAGE:sha-$GITHUB_SHA"

Verification. Inspect exact manifest before push.

Correction validation syntax-validated.

F079 ​

Buildx image inaccessible to docker run

Symptom. unable to find image locally.

Root cause. Container driver doesn't load result by default.

Broken example

bash
docker buildx build -t web:ci .
docker run --rm web:ci

Corrected example

bash
docker buildx build --load --platform linux/amd64 -t web:ci .
docker run --rm web:ci

Verification. Verify docker image inspect succeeds after single-platform load.

Correction validation syntax-validated.

F080 ​

Registry certificate fails verification

Symptom. certificate signed by unknown authority.

Root cause. Private CA is missing from trusted clients.

Broken example

bash
curl -k "https://$REGISTRY/v2/"

Corrected example

bash
curl --cacert ci/registry-ca.pem "https://$REGISTRY/v2/"

Verification. Trust approved CA through Docker daemon config and confirm chain.

Correction validation syntax-validated.

F081 ​

Wrong CPU image selected on runtime host

Symptom. no matching manifest or exec format error.

Root cause. Single image has incompatible architecture.

Broken example

bash
docker run --rm "$IMAGE:arm64"

Corrected example

bash
docker buildx imagetools inspect "$IMAGE:multi"
docker run --rm "$IMAGE:multi"

Verification. Check manifest list for target architecture.

Correction validation syntax-validated.

F082 ​

Disk fills from unbounded images

Symptom. no space left on device.

Root cause. Per-run images were retained indefinitely.

Broken example

bash
docker build -t "web:$RUN_ID" .

Corrected example

bash
docker system df
docker build -t "web:$RUN_ID" .
docker image rm "web:$RUN_ID"

Verification. Use ephemeral runners or bounded cleanup after tests with no shared image deletion.

Correction validation syntax-validated.