-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
docs: restructure descriptions for add, copy, run flags #4688
docs: restructure descriptions for add, copy, run flags #4688
Conversation
bb52ba7
to
0189bd0
Compare
## RUN --mount | ||
### RUN --mount | ||
|
||
> **Note** | ||
> | ||
> Added in [`docker/dockerfile:1.2`](#syntax) | ||
|
||
```dockerfile | ||
RUN --mount=[type=<TYPE>][,option=<value>[,option=<value>]...] | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewer: These changes for RUN
flags are just to keep things consistent between the different commands
ADD [--chown=<user>:<group>] [--chmod=<perms> [--exclude=<exclude>]... [--checksum=<checksum>] <src>... <dest> | ||
ADD [--chown=<user>:<group>] [--chmod=<perms> [--exclude=<exclude>]... ["<src>",... "<dest>"] | ||
ADD [OPTIONS] <src> ... <dest> | ||
ADD [OPTIONS] ["<src>", ... "<dest>"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewer: IMO this instruction has too many flags now to show them as a one-liner, so I moved all the flags to a list below the synopsis, with links
@@ -1316,79 +1286,87 @@ doesn't support authentication. | |||
- If `<dest>` doesn't exist, it's created, along with all missing directories | |||
in its path. | |||
|
|||
### Verifying a remote file checksum `ADD --checksum=<checksum> <http src> <dest>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewer: I renamed this section (and the "Add a Git repository" one) to ADD --flag
to keep consistency with the others
0189bd0
to
30d3516
Compare
30d3516
to
3a32318
Compare
translating user and group names to IDs restricts this feature to only be viable for | ||
Linux OS-based containers. | ||
|
||
All new files and directories are created with a UID and GID of 0, unless the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only true for files copied from the build context. Otherwise, files keep their original uid/gid. Also, this conversion happens in build context transfer so is not COPY
-specific. Eg. if mounts are used then it also build context files have already become uid/gid=0 before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Since this isn't new or changed in this PR (I just moved it into a section) I think we can do a follow-up. I think we can call this out on the context page and link to there. https://docs.docker.com/build/building/context/
> **Note** | ||
> | ||
> Added in [`docker/dockerfile:1.1`](#syntax) | ||
```dockerfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the removal of the minimum versions for the older flags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
References to very old versions (e.g. 1.1) were kinda noisy I thought, and at some point we'd probably want a cleanup, for example I think we might still carry references to Docker 17.x in some places. But maybe n-2 from stable is too aggressive.
With your other suggestion of adding it in the list it's less intrusive, so let's try that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @crazy-max wdyt about version callout for these flags? See also Tonis' other comment https://github.com/moby/buildkit/pull/4688/files#r1503506056
I wonder if we should have a table somewhere summarizing the new syntax features and when they were introduced (or what their status is, if they're still in labs for example)
> | ||
> The `--exclude` option can be specified multiple times and cause files matching its patterns not to be copied, | ||
> even if the files paths match the pattern specified in `<src>`. This feature requires the build tag `dfexcludepatterns`. | ||
- [`--keep-git-dir`](#add---keep-git-dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this list of flags for ADD/COPY, would it make sense to put "(since vX.X)" behind them so it is clear when they can be used.
Signed-off-by: David Karlsson <[email protected]>
3a32318
to
9af155a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave to possible versioning changes to follow-up then.
Restructure information about
ADD
/COPY
flags,describing flags/options in dedicated sections.
Also made some changes to
RUN
for sake of uniformityFollow-up to #4561
Previews: