Skip to content
Open
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
17 changes: 17 additions & 0 deletions frontend/dockerfile/docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1967,6 +1967,23 @@ path, using `--link` is always recommended. The performance of `--link` is
equivalent or better than the default behavior and, it creates much better
conditions for cache reuse.

When copying a path into a subdirectory, `--link` will always create the
parent directories with the default directory creation settings and will always
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

always create the
parent directories with the default directory creation settings

I think it creates the parent directories in whatever settings that were set by the copy command.

copy from the root of the filesystem. When copying a directory, the existing
mode is overridden with the new mode from the copied path. If you need a specific
mode for a directory, such as the more permissive `/tmp` directory, you may need
to either avoid using `--link` or unroll the copy into its base components.

```dockerfile
FROM scratch AS staging
COPY a.txt /tmp/a.txt

FROM alpine
# Avoids overwriting the mode of /tmp but also has the same
# benefits of using --link=true.
COPY --from=staging /tmp/ /tmp/
```

### COPY --parents

```dockerfile
Expand Down