Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ARG sytnax definition in dockerfile reference #5427

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions frontend/dockerfile/docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ This can be used to:
The supported mount types are:

| Type | Description |
| ---------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| [`bind`](#run---mounttypebind) (default) | Bind-mount context directories (read-only). |
| [`cache`](#run---mounttypecache) | Mount a temporary directory to cache directories for compilers and package managers. |
| [`tmpfs`](#run---mounttypetmpfs) | Mount a `tmpfs` in the build container. |
Expand All @@ -741,7 +741,7 @@ This mount type allows binding files or directories to the build container. A
bind mount is read-only by default.

| Option | Description |
| ---------------- | ---------------------------------------------------------------------------------------------- |
| ---------------------------------- | ---------------------------------------------------------------------------------------------- |
| `target`, `dst`, `destination`[^1] | Mount path. |
| `source` | Source path in the `from`. Defaults to the root of the `from`. |
| `from` | Build stage, context, or image name for the root of the source. Defaults to the build context. |
Expand All @@ -753,7 +753,7 @@ This mount type allows the build container to cache directories for compilers
and package managers.

| Option | Description |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id` | Optional ID to identify separate/different caches. Defaults to value of `target`. |
| `target`, `dst`, `destination`[^1] | Mount path. |
| `ro`,`readonly` | Read-only if set. |
Expand Down Expand Up @@ -802,7 +802,7 @@ case.
This mount type allows mounting `tmpfs` in the build container.

| Option | Description |
| ------------ | ----------------------------------------------------- |
| ---------------------------------- | ----------------------------------------------------- |
| `target`, `dst`, `destination`[^1] | Mount path. |
| `size` | Specify an upper limit on the size of the filesystem. |

Expand Down Expand Up @@ -863,7 +863,7 @@ This mount type allows the build container to access SSH keys via SSH agents,
with support for passphrases.

| Option | Description |
| ---------- | ---------------------------------------------------------------------------------------------- |
| ------------------------------ | ---------------------------------------------------------------------------------------------- |
| `id` | ID of SSH agent socket or key. Defaults to "default". |
| `target`, `dst`, `destination` | SSH agent socket path. Defaults to `/run/buildkit/ssh_agent.${N}`. |
| `required` | If set to `true`, the instruction errors out when the key is unavailable. Defaults to `false`. |
Expand Down Expand Up @@ -2310,7 +2310,7 @@ Therefore, to avoid unintended operations in unknown directories, it's best prac
## ARG

```dockerfile
ARG <name>[=<default value>]
ARG <name>[=<default value>] ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if the more correct presentation of this would be (more clearly indicating that the first key/value is required, and more are optional);

Suggested change
ARG <name>[=<default value>] ...
ARG <name>[=<default value>] [<name>[=<default value>]...]

Similar to how (e.g.) we do for docker stop and docker service scale;

docker stop --help

Usage:  docker stop [OPTIONS] CONTAINER [CONTAINER...]
docker service scale --help

Usage:  docker service scale SERVICE=REPLICAS [SERVICE=REPLICAS...]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh! Too late, just merged 😂

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess your suggestion is more correct but this was also the variant used in ENV and LABEL. So modifications should be done together then.

```

The `ARG` instruction defines a variable that users can pass at build-time to
Expand Down
Loading