Files
podman/docs/source/markdown/options/build-context.md
Oleksandr Redko 560455cbd6 docs: fix typos
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2024-01-04 12:10:11 +02:00

31 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

####> 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 (This option is not available with the remote Podman client. On Podman machine setup (i.e macOS and Windows) path must exists on the machine VM)
* 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:
```dockerfile
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