Given the following Dockerfile
FROM ubuntu RUN groupadd mygroup RUN useradd -ms /bin/bash -G mygroup john MKDIR /data COPY test/ /data/test data RUN chown -R joh
A --chown flag has finally been added to COPY:
--chown
COPY
COPY --chown=patrick hostPath containerPath
This new syntax seems to work on Docker 17.09.
See the PR for more information.