From d61d189328bf7e89d668e7f23b896028a1d45f86 Mon Sep 17 00:00:00 2001 From: Jan Kiesewetter <3628035+t3easy@users.noreply.github.com> Date: Tue, 6 Apr 2021 06:15:54 +0200 Subject: [PATCH] Change owner while copy (#7552) * Change owner while copy Copy all files and chown them in a 2nd layer leads to a larger image. See layer 22 and 26 of https://hub.docker.com/layers/snipe/snipe-it/v4.7.8/images/sha256-67c865d91df1b90cef1112f12bbc9c64402dfeafde0bdb160c4f07e785ee0bcc * Copy docker.env as user docker --- Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 130c901ea496..23547372d735 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,7 +73,7 @@ COPY docker/001-default-ssl.conf /etc/apache2/sites-available/001-default-ssl.co RUN a2enmod ssl RUN a2ensite 001-default-ssl.conf -COPY . /var/www/html +COPY --chown=docker . /var/www/html RUN a2enmod rewrite @@ -86,9 +86,7 @@ WORKDIR /var/www/html #copy all configuration files # COPY docker/*.php /var/www/html/app/config/production/ -COPY docker/docker.env /var/www/html/.env - -RUN chown -R docker /var/www/html +COPY --chown=docker docker/docker.env /var/www/html/.env RUN \ rm -r "/var/www/html/storage/private_uploads" && ln -fs "/var/lib/snipeit/data/private_uploads" "/var/www/html/storage/private_uploads" \