LinuxCommandLibrary

podman-build

Build container images from Containerfiles

TLDR

Build from Containerfile

$ podman build -t [image:tag] [path]
copy
Build with specific file
$ podman build -f [Dockerfile] -t [image] [path]
copy
Build without cache
$ podman build --no-cache -t [image] [path]
copy
Build with build args
$ podman build --build-arg [KEY=value] -t [image] [path]
copy

SYNOPSIS

podman build [options] path

DESCRIPTION

podman build creates container images from a Containerfile (or Dockerfile) in the specified build context directory. It is compatible with Docker build syntax and supports multi-stage builds, build arguments, and layer caching.
Under the hood, it uses Buildah for the actual image building process. The --no-cache flag forces rebuilding all layers, --build-arg passes build-time variables, and --squash merges all layers into a single layer. The output is an OCI-compliant container image.

PARAMETERS

PATH

Build context directory.
-t, --tag NAME
Image name and tag.
-f, --file FILE
Containerfile path.
--no-cache
Don't use build cache.
--build-arg ARG
Build-time variables.
--pull
Always pull base image.
--squash
Squash layers.

CAVEATS

Uses Buildah under the hood. Docker build compatible.

HISTORY

podman build uses Buildah for OCI-compliant image building.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community