Reputation: 6076
I've hit a wall on trying to user the COPY command in a dockerfile. When building with --privileged, it's not a problem, but that switch is not viable from a security standpoint. Here's what's happening:
For the last item above, I would like the files to show as user123.
I've tried/confirmed the following:
I've also tried COPY --chown in the dockerfile, but that option isn't available because the docker server version is stuck in the stone ages (1.13).
To state the obvious, this is occurring during a docker build.
Upvotes: 3
Views: 1386
Reputation: 20196
If you can't use COPY --chown
why don't you RUN
chown after copy?
RUN chown -R 123:123 file
Also why do you have to build the image on the server? You can build it elsewhere, where a more recent Docker version is available. Then deliver the image to the server via repository or through export/import.
Upvotes: 3