Skip to content

Commit

Permalink
Docs: Semiautomatic platform ARGs
Browse files Browse the repository at this point in the history
Available for quite some time, but often useful and undocumented.
Fix that and a minor whitespace problem.

Signed-off-by: Chris Evich <cevich@redhat.com>
  • Loading branch information
cevich committed Jul 10, 2024
1 parent 3def543 commit 69922d8
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion docs/Containerfile.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Current supported mount TYPES are bind, cache, secret and tmpfs.
The relabel=private and Z options tell the engine to label the content with a private unshared label. Only the current container can use a private mount.

Relabeling walks the file system under the mount and changes the label on each file, if the mount has thousands of inodes, this process takes a long time, delaying the start of the container.

· rw, read-write: allows writes on the mount.

Options specific to tmpfs:
Expand Down Expand Up @@ -606,6 +606,38 @@ The secret needs to be passed to the build using the --secret flag. The final im
$ podman build --build-arg HTTPS_PROXY=https://my-proxy.example.com .
```

Platform/OS/Arch **ARG**
-- ARG <name>

Additional semiautomatic predefined `ARG` variables are available to
assist when producing multi-arch manifest-lists or foreign-architecture
images. The purpose of each of of these variables should mostly be
evident from their names. Where the "BUILD" prefix signifies details
about the host performing the build, and the "TARGET" prefix represents
the intended platform for the content.

Each of the following ARG variables must be defined empty before use,
within each `FROM` section of the `Containerfile`. If not defined, they
will _not_ be populated with values at build time. Not all variables
are applicable to every OS and/or ARCH (for example `VARIANT`).

* `BUILDPLATFORM`: for example "linux/amd64"
* `BUILDOS`: for example "linux"
* `BUILDARCH`: for example "amd64"
* `BUILDVARIANT`: uncommonly used, specific to arch.
* `TARGETPLATFORM`
* `TARGETOS`
* `TARGETARCH`
* `TARGETVARIANT`

Example `Containerfile`:

```
FROM busybox
ARG TARGETARCH
RUN curl -sSf -O https://example.com/app/downloads/foo-${TARGETARCH}.zip
```

**ONBUILD**
-- `ONBUILD [INSTRUCTION]`
The **ONBUILD** instruction adds a trigger instruction to an image. The
Expand Down

0 comments on commit 69922d8

Please sign in to comment.