Quellcode durchsuchen

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

Fabian Peter Hammerle vor 5 Jahren
Ursprung
Commit
ae93815d8c
1 geänderte Dateien mit 1 neuen und 2 gelöschten Zeilen
  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