Browse Source

tool: Use alpine based docker image to reduce image size

pull/416/head
jld3103 1 year ago
parent
commit
6002bced45
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 4
      tool/Dockerfile.dev
  2. 2
      tool/update.sh

4
tool/Dockerfile.dev

@ -1,4 +1,4 @@
FROM nextcloud:27.0.0 FROM nextcloud:27.0.0-fpm-alpine
WORKDIR /usr/src/nextcloud WORKDIR /usr/src/nextcloud
RUN chown -R www-data:www-data . RUN chown -R www-data:www-data .
USER www-data USER www-data
@ -16,7 +16,7 @@ RUN ./occ app:install notes --force --allow-unstable # 4.8.0
RUN ./occ app:install uppush --force --allow-unstable # 1.4.0 RUN ./occ app:install uppush --force --allow-unstable # 1.4.0
RUN ./occ app:enable password_policy RUN ./occ app:enable password_policy
RUN (bash /entrypoint.sh php -S 0.0.0.0:8080 &) && \ RUN (sh /entrypoint.sh php -S 0.0.0.0:8080 &) && \
until curl -s -o /dev/null http://localhost:8080/status.php; do true; done && \ until curl -s -o /dev/null http://localhost:8080/status.php; do true; done && \
for user in admin user1 user2; do curl -u "$user:$user" -H "ocs-apirequest: true" -s -o /dev/null http://localhost:8080/ocs/v2.php/cloud/user; done for user in admin user1 user2; do curl -u "$user:$user" -H "ocs-apirequest: true" -s -o /dev/null http://localhost:8080/ocs/v2.php/cloud/user; done
COPY --chown=www-data:www-data overlay /usr/src/nextcloud/ COPY --chown=www-data:www-data overlay /usr/src/nextcloud/

2
tool/update.sh

@ -27,7 +27,7 @@ elif [ -d "external/nextcloud-$1" ]; then
# shellcheck disable=SC2001 # shellcheck disable=SC2001
latest_version=$(echo "$latest_tag" | sed "s/^v//") latest_version=$(echo "$latest_tag" | sed "s/^v//")
if [[ "$1" == "server" ]]; then if [[ "$1" == "server" ]]; then
sed -i "s/FROM nextcloud:.*/FROM nextcloud:$latest_version/" ../../tool/Dockerfile.dev sed -i "s/FROM nextcloud:.*/FROM nextcloud:$latest_version-fpm-alpine/" ../../tool/Dockerfile.dev
else else
sed -i "s/RUN \.\/occ app:install $1 .*/RUN .\/occ app:install $1 --force --allow-unstable # $latest_version/" ../../tool/Dockerfile.dev sed -i "s/RUN \.\/occ app:install $1 .*/RUN .\/occ app:install $1 --force --allow-unstable # $latest_version/" ../../tool/Dockerfile.dev
fi fi

Loading…
Cancel
Save