Skip to content

Commit

Permalink
Change owner while copy (#7552)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
t3easy authored Apr 6, 2021
1 parent b5f7cb5 commit d61d189
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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" \
Expand Down

0 comments on commit d61d189

Please sign in to comment.