소스 검색

refactor: 'COPY --chown' instead of COPY + RUN

Fabian Peter Hammerle 5 년 전
부모
커밋
ae93815d8c
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      Dockerfile

+ 1 - 2
Dockerfile

@@ -10,8 +10,7 @@ COPY ssh_config /etc/ssh/ssh_config
 RUN chmod a=r /etc/ssh/ssh_config
 
 RUN adduser -S tunnel
-COPY known_hosts /home/tunnel/.ssh/known_hosts
-RUN chown tunnel /home/tunnel/.ssh/known_hosts
+COPY --chown=tunnel:nogroup known_hosts /home/tunnel/.ssh/known_hosts
 USER tunnel
 
 ENV BIND_ADDRESS bind-address