In dockerfile:
ADD –chown=x:y /path/to/a/file /path/in/container
I understand ADD is used for copying files in container. chown is linux way of changing file ownership.
What does the x and y(represented as placeholders here) mean?
In dockerfile:
ADD –chown=x:y /path/to/a/file /path/in/container
I understand ADD is used for copying files in container. chown is linux way of changing file ownership.
What does the x and y(represented as placeholders here) mean?
2
Answers
As mentioned in the comments, the answer is in the Dockerfile reference documentation for
ADD
instruction:chown
= "change owner". It’s the standard util for changing file owner & group on GNU/Linux.In
chown x:y /path/to/file
,x
is the Unix user (user name or UID), andy
is the Unix group (group name or GID). See https://manned.org/chown.Here Docker borrows its standard syntax to do the same thing.