Skip to content

Commit 9a8648b

Browse files
committed
docs: dockerfile chmod variable interpolation
Signed-off-by: David Karlsson <[email protected]>
1 parent de65ae6 commit 9a8648b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

frontend/dockerfile/docs/reference.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,6 +1646,18 @@ If the container root filesystem doesn't contain either `/etc/passwd` or
16461646
flag, the build will fail on the `COPY` operation. Using numeric IDs requires
16471647
no lookup and does not depend on container root filesystem content.
16481648

1649+
With the Dockerfile syntax version 1.10.0 and later,
1650+
the `--chmod` flag supports variable interpolation,
1651+
which lets you define the permission bits using build arguments:
1652+
1653+
```dockerfile
1654+
# syntax=docker/dockerfile:1.10
1655+
FROM alpine
1656+
WORKDIR /src
1657+
ARG MODE=440
1658+
COPY --chmod=$MODE . .
1659+
```
1660+
16491661
### COPY --link
16501662

16511663
```dockerfile

0 commit comments

Comments
 (0)