From 1f413b8d76e56c1f6edb2859224e4953ed230390 Mon Sep 17 00:00:00 2001 From: Shiro Hara Date: Thu, 4 May 2023 16:18:26 +0900 Subject: [PATCH] Add dockerhub information --- README.md | 13 +++++++++---- build.sh | 10 +++++++++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4446af3..684e541 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,15 @@ HTTP/2, PHP-FPM, Redis cache and Samba client enabled Nextcloud docker image This docker image is Nextcloud image which is enabled HTTP/2, PHP-FPM, Redis cache and Samba client with small memory tweaks. This image is used to learn how it works. If you want to get the production ready one, I recommend to use https://github.com/nextcloud/all-in-one -## How to build docker image? + +## Use it from dockerhub +``` +docker run -d -p 8080:80 whitehara/nextcloud-docker-http2 +``` +Now you can access Nextcloud at http://localhost:8080/ from your host system. + +You may need to add some options for using, please see: https://github.com/nextcloud/docker +## How to build your customized docker image? ``` git clone https://github.com/whitehara/nextcloud-docker-http2 . cd nextcloud-docker-http2 @@ -12,9 +20,6 @@ cd nextcloud-docker-http2 ``` You get "nextcloud-custom" image. -## How to run the docker image -You can run this image like the normal nextcloud image. -Please see: https://github.com/nextcloud/docker ## Details This docker image is based on three parts. diff --git a/build.sh b/build.sh index 730257b..97364f2 100755 --- a/build.sh +++ b/build.sh @@ -5,21 +5,29 @@ PHP_VER=8.1 PHP_TAG=local-php:$PHP_VER-apache-zts-bullseye PHP_DIR=./php/$PHP_VER/bullseye/apache/ +# Update the repository (cd php; git reset --hard; git pull) +# Modify Dockerfile sed -i -e "s/\(--with-apxs2\)/\1 --enable-zts --disable-zend-signals --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data /g" $PHP_DIR/Dockerfile +# Build docker build -t $PHP_TAG --pull --no-cache $PHP_DIR ### 2nd stage: nextcloud ### -NEXTCLOUD_VER=26 +NEXTCLOUD_VER=`awk -F'.' '{print $1}' nextcloud/latest.txt` NEXTCLOUD_TAG=local-nextcloud:$NEXTCLOUD_VER-apache-zts NEXTCLOUD_DIR=./nextcloud/$NEXTCLOUD_VER/apache/ +# Update the repository (cd nextcloud; git reset --hard; git pull) +# Modify Dockerfile sed -i -e "s!FROM .*!FROM $PHP_TAG!g" $NEXTCLOUD_DIR/Dockerfile +# Build docker build -t $NEXTCLOUD_TAG $NEXTCLOUD_DIR ### 3rd stage: nextcloud-custom ### CUSTOM_TAG=nextcloud-custom +# Modify Dockerfile sed -i -e "s!FROM .*!FROM $NEXTCLOUD_TAG!g" ./Dockerfile +# Build docker build -t $CUSTOM_TAG .