Browse Source

Adding VERSION build args

bodicsek 7 năm trước cách đây
mục cha
commit
a1268d7e54
4 tập tin đã thay đổi với 24 bổ sung4 xóa
  1. 5 3
      Dockerfile
  2. 1 1
      build.sh
  3. 0 0
      nextcloud-entrypoint.sh
  4. 18 0
      nextcloud-setperms.sh

+ 5 - 3
Dockerfile

@@ -1,13 +1,15 @@
-FROM arm32v7/nextcloud:14.0.0
+ARG version
+
+FROM arm32v7/nextcloud:$version
 
 LABEL Description="Official nextcloud arm32v7 image for rpi with cron configured."
 
-COPY ./rpi-entrypoint.sh /
+COPY ./nextcloud* /
 
 RUN apt-get update && apt-get install -y --no-install-recommends cron && \
     (crontab -u www-data -l 2>/dev/null; echo "*/15  *  *  *  * /usr/local/bin/php -f /var/www/html/cron.php") | crontab -u www-data - && \
     crontab -u www-data -l | grep -v '* php' | crontab -u www-data -
 
-ENTRYPOINT ["/rpi-entrypoint.sh"]
+ENTRYPOINT ["/nextcloud-entrypoint.sh"]
 CMD ["apache2-foreground"]
 

+ 1 - 1
build.sh

@@ -2,7 +2,7 @@
 
 VERSION=14.0.0
 
-docker build --force-rm -t bodicsek/nextcloud-armhf:$VERSION .
+docker build --build-arg version=$VERSION --force-rm -t bodicsek/nextcloud-armhf:$VERSION .
 
 docker tag bodicsek/nextcloud-armhf:$VERSION bodicsek/nextcloud-armhf:latest
 

+ 0 - 0
rpi-entrypoint.sh → nextcloud-entrypoint.sh


+ 18 - 0
nextcloud-setperms.sh

@@ -0,0 +1,18 @@
+#!/bin/bash
+ncpath='/var/www/html'
+htuser='www-data'
+htgroup='www-data'
+rootuser='root'
+
+printf "chmod Files and Directories\n"
+find ${ncpath}/ -type f -print0 | xargs -0 chmod 0640
+find ${ncpath}/ -type d -print0 | xargs -0 chmod 0750
+chmod +x ${ncpath}/occ
+
+printf "chown Files and Directories\n"
+chown -R ${htuser}:${htgroup} ${ncpath}
+
+printf "chmod/chown .htaccess\n"
+find ${ncpath}/ -name .htaccess -print0 | xargs -0 chmod 0644
+find ${ncpath}/ -name .htaccess -print0 | xargs -0 chown ${rootuser}:${htgroup}
+