You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know there's a rich history for adding an ADD/COPY --chmod=... flag similar to the --chown=... flag to the Dockerfile syntax, but I don't see a feature request here in this repo where it seems to belong — could we amend the Dockerfile experimental frontend syntax to add a --chmod=0755 style flag to ADD and COPY commands which populates the mode in the associated FileOp (from #809)? I'd be happy to prototype an implementation if there were appetite.
The main use case is building thin images by adding binaries directly from external sources which don't have a correct mode, like:
FROM scratch
ADD --chmod=0755 https://github.com/pganalyze/collector/releases/download/v0.21.0/pganalyze-collector-linux-amd64 /pganalyze-collector
COMMAND /pganalyze-collector
Currently, the only ways to really do this is download the file outside the Dockerfile, set modes, then copy it in, or to use an intermediate container with a whole lot of extra weight just to use a chmod command and then copy to a subsequent FROM scratch stage.
The text was updated successfully, but these errors were encountered:
sj26
changed the title
dockerfile: experimental ADD/COPY chmod support
dockerfile: experimental ADD/COPY --chmod=...
Jul 16, 2019
could we amend the Dockerfile experimental frontend syntax to add a --chmod=0755 style flag to ADD and COPY commands which populates the mode in the associated FileOp (from #809)?
Yes, this is possible. No LLB/solver changes should be required.
I know there's a rich history for adding an
ADD/COPY --chmod=...
flag similar to the--chown=...
flag to the Dockerfile syntax, but I don't see a feature request here in this repo where it seems to belong — could we amend the Dockerfile experimental frontend syntax to add a--chmod=0755
style flag toADD
andCOPY
commands which populates the mode in the associatedFileOp
(from #809)? I'd be happy to prototype an implementation if there were appetite.The main use case is building thin images by adding binaries directly from external sources which don't have a correct mode, like:
Currently, the only ways to really do this is download the file outside the Dockerfile, set modes, then copy it in, or to use an intermediate container with a whole lot of extra weight just to use a
chmod
command and then copy to a subsequentFROM scratch
stage.The text was updated successfully, but these errors were encountered: