Pcornel
Automation · Container Automation

Image Builds

Cheat sheet · https://pcornel.dk/topic.php?topic=5785

Back to the Topic

Answer

Image builds create container images from a Dockerfile with docker build or BuildKit, ideally in CI with multi-stage builds, pinned base images, caching and vulnerability scanning before push.

Remember

  • Multi-stage builds keep images small.
  • Pin base images by tag or digest.
  • Scan images before pushing.

First checks

  • docker buildx build --platform linux/amd64 -t <img>:<tag> --push . — build and push
  • hadolint Dockerfile — lint
  • docker image inspect <img> --format '{{.Config.User}}' — non-root user

Verify in this order

Dockerfile → buildx → image + SBOM → registry

Where it usually breaks

Commit/input → runner/job → build/test artifact → deployment request → target rollout/reconcile → effective version/config → health/readiness → workload.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5785

Confirmation

Confirm action

Continue?