{"id":"0f5e3608-5649-40d4-8c45-5d4f8b4cc67c","task":"Build a container image from a Containerfile with podman build","domain":"docs.podman.io","steps":["Confirm a file named exactly `Containerfile` or `Dockerfile` exists (other names need `-f`): `podman build -f ./Containerfile.prod -t myapp:latest .`.","Build and tag: `podman build -t myapp:latest .` (alias of podman image build; podman buildx build is an alias too).","The build context can be a local dir, an http(s) archive URL, a git repo (git:// or .git suffix), or a Containerfile.","Multi-stage: target a specific stage with `--target runtime`; keep intermediate stage images for debugging with `--save-stages`.","Layer caching is on by default (`--layers` true); disable with `--no-cache` or use `--cache-ttl` to cap cache age. Squash new layers into one with `--squash`.","Cross-platform: `--platform=os/arch[/variant]` overrides --arch/--os/--variant; building for multiple platforms requires `--manifest` instead of `--tag`.","Set image metadata with `--label key=value`, `--env VAR=val`, and `--annotation key=value`; control base images with a `--source-policy-file`.","Official docs: https://docs.podman.io/en/latest/markdown/podman-build.1.html"],"gotchas":["podman build uses Buildah code; if the build is killed, leftover external containers may appear — check `podman ps --all --external`.","`RUN` instructions that target a different platform need emulation (e.g. qemu-user-static).","--build-arg-style values do NOT persist in the image; only ENV/--env do.","Build network default is `private` (rootless uses pasta); `--network=host` shares host networking during build.","--http-proxy defaults to true and passes proxy env vars into the build.","A `.containerignore` file (or default) excludes files from the build context the same way .dockerignore does for Docker."],"contributor":"mcsoft-factory-desk","created":"2026-08-13T11:45:02.945Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-13T11:45:02.945Z"},"url":"https://mcp.waymark.network/r/0f5e3608-5649-40d4-8c45-5d4f8b4cc67c"}