reduce image size by setting permissions at copy stage
This commit is contained in:
@@ -8,10 +8,6 @@ Dockerfile
|
|||||||
dockerfiles/LICENSE
|
dockerfiles/LICENSE
|
||||||
dockerfiles/README.md
|
dockerfiles/README.md
|
||||||
docs
|
docs
|
||||||
install/pialert_install.sh
|
|
||||||
install/pialert_install_no_webserver.sh
|
|
||||||
install/pialert_uninstall.sh
|
|
||||||
install/pialert_update.sh
|
|
||||||
LICENSE.txt
|
LICENSE.txt
|
||||||
README.md
|
README.md
|
||||||
tar
|
CONTRIBUTING
|
||||||
|
|||||||
13
Dockerfile
13
Dockerfile
@@ -16,17 +16,19 @@ RUN apt-get update \
|
|||||||
&& rm -rf /var/www/html \
|
&& rm -rf /var/www/html \
|
||||||
&& ln -s /home/pi/pialert/front /var/www/html
|
&& ln -s /home/pi/pialert/front /var/www/html
|
||||||
|
|
||||||
|
# create pi user and group
|
||||||
# now creating user
|
# add root and www-data to pi group so they can r/w files and db
|
||||||
RUN groupadd --gid "${USER_GID}" "${USER}" && \
|
RUN groupadd --gid "${USER_GID}" "${USER}" && \
|
||||||
useradd \
|
useradd \
|
||||||
--uid ${USER_ID} \
|
--uid ${USER_ID} \
|
||||||
--gid ${USER_GID} \
|
--gid ${USER_GID} \
|
||||||
--create-home \
|
--create-home \
|
||||||
--shell /bin/bash \
|
--shell /bin/bash \
|
||||||
${USER}
|
${USER} && \
|
||||||
|
usermod -a -G ${USER_GID} root && \
|
||||||
|
usermod -a -G ${USER_GID} www-data
|
||||||
|
|
||||||
COPY . /home/pi/pialert
|
COPY --chmod=775 --chown=${USER_ID}:${USER_GID} . /home/pi/pialert/
|
||||||
|
|
||||||
# Pi.Alert
|
# Pi.Alert
|
||||||
RUN rm /etc/nginx/sites-available/default \
|
RUN rm /etc/nginx/sites-available/default \
|
||||||
@@ -35,7 +37,4 @@ RUN rm /etc/nginx/sites-available/default \
|
|||||||
# run the hardware vendors update
|
# run the hardware vendors update
|
||||||
&& /home/pi/pialert/back/update_vendors.sh
|
&& /home/pi/pialert/back/update_vendors.sh
|
||||||
|
|
||||||
# it's easy for permissions set in Git to be overridden, so doing it manually
|
|
||||||
RUN chmod -R a+rxw /home/pi/pialert/
|
|
||||||
|
|
||||||
CMD ["/home/pi/pialert/dockerfiles/start.sh"]
|
CMD ["/home/pi/pialert/dockerfiles/start.sh"]
|
||||||
Reference in New Issue
Block a user