Files
podman/docs/source/markdown/options/build-context.md
Jan Rodák ab5e400a9a docs: remove remote limitation note for --build-context option
- Removal of a note in the build-context documentation about remote Podman client limitations
- Removal of skip statements for build-context tests in the test suite

Pull request #26628 adds support for --build-context for the remote client.

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-09-15 15:50:02 +02:00

1.2 KiB
Raw Blame History

####> This option file is used in: ####> podman build, farm build ####> If file is edited, make sure the changes ####> are applicable to all of those.

--build-context=name=value

Specify an additional build context using its short name and its location. Additional build contexts can be referenced in the same manner as we access different stages in COPY instruction.

Valid values are:

  • Local directory e.g. --build-context project2=../path/to/project2/src
  • HTTP URL to a tarball e.g. --build-context src=https://example.org/releases/src.tar
  • Container image specified with a container-image:// prefix, e.g. --build-context alpine=container-image://alpine:3.15, (also accepts docker://, docker-image://)

On the Containerfile side, reference the build context on all commands that accept the “from” parameter. Heres how that might look:

FROM [name]
COPY --from=[name] ...
RUN --mount=from=[name]

The value of [name] is matched with the following priority order:

  • Named build context defined with --build-context [name]=..
  • Stage defined with AS [name] inside Containerfile
  • Image [name], either local or in a remote registry