From 9a8648b12c22563f5f013137e858c0e83ce3d836 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Wed, 7 Aug 2024 09:48:44 +0200 Subject: [PATCH] docs: dockerfile chmod variable interpolation Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- frontend/dockerfile/docs/reference.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frontend/dockerfile/docs/reference.md b/frontend/dockerfile/docs/reference.md index a5a0a049fa2e..29d6d1d87ff0 100644 --- a/frontend/dockerfile/docs/reference.md +++ b/frontend/dockerfile/docs/reference.md @@ -1646,6 +1646,18 @@ If the container root filesystem doesn't contain either `/etc/passwd` or flag, the build will fail on the `COPY` operation. Using numeric IDs requires no lookup and does not depend on container root filesystem content. +With the Dockerfile syntax version 1.10.0 and later, +the `--chmod` flag supports variable interpolation, +which lets you define the permission bits using build arguments: + +```dockerfile +# syntax=docker/dockerfile:1.10 +FROM alpine +WORKDIR /src +ARG MODE=440 +COPY --chmod=$MODE . . +``` + ### COPY --link ```dockerfile