Docker Copy and change owner

后端 未结 2 1974
离开以前
离开以前 2021-02-02 04:47

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         


        
2条回答
  •  独厮守ぢ
    2021-02-02 05:34

    A --chown flag has finally been added to COPY:

    COPY --chown=patrick hostPath containerPath
    

    This new syntax seems to work on Docker 17.09.

    See the PR for more information.

提交回复
热议问题