diff --git a/fpm-alpine/19/build b/fpm-alpine/19/build index 63fd93f..c3ec7f7 100755 --- a/fpm-alpine/19/build +++ b/fpm-alpine/19/build @@ -1,6 +1,47 @@ -#!/bin/sh +#!/bin/bash -docker pull nextcloud:19-fpm-alpine -docker build $1\ - -t bkraul/nextcloud:19-fpm-alpine \ - . +# define variables. +IMAGE_VARIANT=fpm-alpine +IMAGE_VERSION=19 +UPSTREAM_IMAGE=nextcloud +UPSTREAM_IMAGE_TAG=${IMAGE_VERSION}-${IMAGE_VARIANT} +IMAGE=bkraul/nextcloud + +# set username and password +# requires vars DOCKER_USER and DOCKER_PASS to be defined before calling. + +# useful functions. +function docker_tag_exists() { + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${DOCKER_USER}'", "password": "'${DOCKER_PASS}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + curl --silent -f --head -lL https://hub.docker.com/v2/repositories/$1/tags/$2/ > /dev/null +} + +# pull the parent image from docker hub. +docker pull ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG} +UPSTREAM_ID=$(docker image inspect --format='{{index .Id}}' ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG}) +UPSTREAM_ID=${UPSTREAM_ID:7} + +# get the version number. +NEXTCLOUD_VERSION=$(docker inspect ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG} | jq -r '.[].Config.Env[] | select(match("^NEXTCLOUD_VERSION"))') +NEXTCLOUD_VERSION=${NEXTCLOUD_VERSION:18} +IMAGE_TAG=${NEXTCLOUD_VERSION}-${IMAGE_VARIANT} + +if docker_tag_exists ${IMAGE} ${IMAGE_TAG}; then + # nothing to do, the image already exists. + echo Image ${IMAGE}:${IMAGE_TAG} already exists. +else + # image doesn't exist we need build and push + echo Image ${IMAGE}:${IMAGE_TAG} does not exist. + echo "Building image(s)..." + docker build $1 \ + -t ${IMAGE}:${UPSTREAM_IMAGE_TAG} \ + -t ${IMAGE}:${IMAGE_TAG} + if [ $? == 0 ]; then + echo "Pushing image(s)..." + docker push ${IMAGE}:${IMAGE_TAG} + docker push ${IMAGE}:${UPSTREAM_IMAGE_TAG} + else + echo "The build operation failed." + echo "Please debug and try again." + fi +fi \ No newline at end of file diff --git a/fpm-alpine/19/push b/fpm-alpine/19/push deleted file mode 100755 index a12da9b..0000000 --- a/fpm-alpine/19/push +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -docker push bkraul/nextcloud:19-fpm-alpine - diff --git a/fpm-alpine/20/build b/fpm-alpine/20/build index 96ff400..9e0e7ac 100755 --- a/fpm-alpine/20/build +++ b/fpm-alpine/20/build @@ -1,6 +1,48 @@ -#!/bin/sh +#!/bin/bash -docker pull nextcloud:20-fpm-alpine -docker build $1\ - -t bkraul/nextcloud:20-fpm-alpine \ - . +# define variables. +IMAGE_VARIANT=fpm-alpine +IMAGE_VERSION=20 +UPSTREAM_IMAGE=nextcloud +UPSTREAM_IMAGE_TAG=${IMAGE_VERSION}-${IMAGE_VARIANT} +IMAGE=bkraul/nextcloud + +# set username and password +# requires vars DOCKER_USER and DOCKER_PASS to be defined before calling. + +# useful functions. +function docker_tag_exists() { + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${DOCKER_USER}'", "password": "'${DOCKER_PASS}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + curl --silent -f --head -lL https://hub.docker.com/v2/repositories/$1/tags/$2/ > /dev/null +} + +# pull the parent image from docker hub. +docker pull ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG} +UPSTREAM_ID=$(docker image inspect --format='{{index .Id}}' ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG}) +UPSTREAM_ID=${UPSTREAM_ID:7} + +# get the version number. +NEXTCLOUD_VERSION=$(docker inspect ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG} | jq -r '.[].Config.Env[] | select(match("^NEXTCLOUD_VERSION"))') +NEXTCLOUD_VERSION=${NEXTCLOUD_VERSION:18} +IMAGE_TAG=${NEXTCLOUD_VERSION}-${IMAGE_VARIANT} + +if docker_tag_exists ${IMAGE} ${IMAGE_TAG}; then + # nothing to do, the image already exists. + echo Image ${IMAGE}:${IMAGE_TAG} already exists. +else + exit 0 + # image doesn't exist we need build and push + echo Image ${IMAGE}:${IMAGE_TAG} does not exist. + echo "Building image(s)..." + docker build $1 \ + -t ${IMAGE}:${UPSTREAM_IMAGE_TAG} \ + -t ${IMAGE}:${IMAGE_TAG} + if [ $? == 0 ]; then + echo "Pushing image(s)..." + docker push ${IMAGE}:${IMAGE_TAG} + docker push ${IMAGE}:${UPSTREAM_IMAGE_TAG} + else + echo "The build operation failed." + echo "Please debug and try again." + fi +fi \ No newline at end of file diff --git a/fpm-alpine/20/push b/fpm-alpine/20/push deleted file mode 100755 index fa128e9..0000000 --- a/fpm-alpine/20/push +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -docker push bkraul/nextcloud:20-fpm-alpine - diff --git a/fpm-alpine/21/Dockerfile b/fpm-alpine/21/Dockerfile new file mode 100644 index 0000000..10d6d8f --- /dev/null +++ b/fpm-alpine/21/Dockerfile @@ -0,0 +1,21 @@ +FROM nextcloud:21-fpm-alpine + +RUN set -ex; \ + apk add --no-cache --virtual .build-deps \ + autoconf \ + automake \ + file \ + g++ \ + gcc \ + make \ + php7-dev \ + re2c \ + samba-dev \ + zlib-dev; \ + apk add --no-cache libsmbclient; \ + pecl install smbclient; \ + docker-php-ext-enable smbclient; \ + apk add --no-cache imagemagick; \ + apk del .build-deps + +COPY redis.config.php /usr/src/nextcloud/config/redis.config.php diff --git a/fpm-alpine/21/build b/fpm-alpine/21/build new file mode 100755 index 0000000..4da24ba --- /dev/null +++ b/fpm-alpine/21/build @@ -0,0 +1,48 @@ +#!/bin/bash + +# define variables. +IMAGE_VARIANT=fpm-alpine +IMAGE_VERSION=21 +UPSTREAM_IMAGE=nextcloud +UPSTREAM_IMAGE_TAG=${IMAGE_VERSION}-${IMAGE_VARIANT} +IMAGE=bkraul/nextcloud + +# set username and password +# requires vars DOCKER_USER and DOCKER_PASS to be defined before calling. + +# useful functions. +function docker_tag_exists() { + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${DOCKER_USER}'", "password": "'${DOCKER_PASS}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + curl --silent -f --head -lL https://hub.docker.com/v2/repositories/$1/tags/$2/ > /dev/null +} + +# pull the parent image from docker hub. +docker pull ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG} +UPSTREAM_ID=$(docker image inspect --format='{{index .Id}}' ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG}) +UPSTREAM_ID=${UPSTREAM_ID:7} + +# get the version number. +NEXTCLOUD_VERSION=$(docker inspect ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG} | jq -r '.[].Config.Env[] | select(match("^NEXTCLOUD_VERSION"))') +NEXTCLOUD_VERSION=${NEXTCLOUD_VERSION:18} +IMAGE_TAG=${NEXTCLOUD_VERSION}-${IMAGE_VARIANT} + +if docker_tag_exists ${IMAGE} ${IMAGE_TAG}; then + # nothing to do, the image already exists. + echo Image ${IMAGE}:${IMAGE_TAG} already exists. +else + exit 0 + # image doesn't exist we need build and push + echo Image ${IMAGE}:${IMAGE_TAG} does not exist. + echo "Building image(s)..." + docker build $1 \ + -t ${IMAGE}:${UPSTREAM_IMAGE_TAG} \ + -t ${IMAGE}:${IMAGE_TAG} + if [ $? == 0 ]; then + echo "Pushing image(s)..." + docker push ${IMAGE}:${IMAGE_TAG} + docker push ${IMAGE}:${UPSTREAM_IMAGE_TAG} + else + echo "The build operation failed." + echo "Please debug and try again." + fi +fi \ No newline at end of file diff --git a/fpm-alpine/21/redis.config.php b/fpm-alpine/21/redis.config.php new file mode 100644 index 0000000..b0cebe3 --- /dev/null +++ b/fpm-alpine/21/redis.config.php @@ -0,0 +1,8 @@ + '\OC\Memcache\Redis', + 'redis' => array( + 'host' => 'redis', + 'port' => 6379, + ), +); diff --git a/fpm/19/build b/fpm/19/build index 5b8ab16..5ff70f5 100755 --- a/fpm/19/build +++ b/fpm/19/build @@ -1,6 +1,47 @@ -#!/bin/sh +#!/bin/bash -docker pull nextcloud:19-fpm -docker build $1\ - -t bkraul/nextcloud:19-fpm \ - . +# define variables. +IMAGE_VARIANT=fpm +IMAGE_VERSION=19 +UPSTREAM_IMAGE=nextcloud +UPSTREAM_IMAGE_TAG=${IMAGE_VERSION}-${IMAGE_VARIANT} +IMAGE=bkraul/nextcloud + +# set username and password +# requires vars DOCKER_USER and DOCKER_PASS to be defined before calling. + +# useful functions. +function docker_tag_exists() { + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${DOCKER_USER}'", "password": "'${DOCKER_PASS}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + curl --silent -f --head -lL https://hub.docker.com/v2/repositories/$1/tags/$2/ > /dev/null +} + +# pull the parent image from docker hub. +docker pull ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG} +UPSTREAM_ID=$(docker image inspect --format='{{index .Id}}' ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG}) +UPSTREAM_ID=${UPSTREAM_ID:7} + +# get the version number. +NEXTCLOUD_VERSION=$(docker inspect ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG} | jq -r '.[].Config.Env[] | select(match("^NEXTCLOUD_VERSION"))') +NEXTCLOUD_VERSION=${NEXTCLOUD_VERSION:18} +IMAGE_TAG=${NEXTCLOUD_VERSION}-${IMAGE_VARIANT} + +if docker_tag_exists ${IMAGE} ${IMAGE_TAG}; then + # nothing to do, the image already exists. + echo Image ${IMAGE}:${IMAGE_TAG} already exists. +else + # image doesn't exist we need build and push + echo Image ${IMAGE}:${IMAGE_TAG} does not exist. + echo "Building image(s)..." + docker build $1 \ + -t ${IMAGE}:${UPSTREAM_IMAGE_TAG} \ + -t ${IMAGE}:${IMAGE_TAG} + if [ $? == 0 ]; then + echo "Pushing image(s)..." + docker push ${IMAGE}:${IMAGE_TAG} + docker push ${IMAGE}:${UPSTREAM_IMAGE_TAG} + else + echo "The build operation failed." + echo "Please debug and try again." + fi +fi \ No newline at end of file diff --git a/fpm/19/push b/fpm/19/push deleted file mode 100755 index 552834a..0000000 --- a/fpm/19/push +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -docker push bkraul/nextcloud:19-fpm - diff --git a/fpm/20/build b/fpm/20/build index d188083..8b01ddb 100755 --- a/fpm/20/build +++ b/fpm/20/build @@ -1,6 +1,47 @@ -#!/bin/sh +#!/bin/bash -docker pull nextcloud:20-fpm -docker build $1\ - -t bkraul/nextcloud:20-fpm \ - . +# define variables. +IMAGE_VARIANT=fpm +IMAGE_VERSION=20 +UPSTREAM_IMAGE=nextcloud +UPSTREAM_IMAGE_TAG=${IMAGE_VERSION}-${IMAGE_VARIANT} +IMAGE=bkraul/nextcloud + +# set username and password +# requires vars DOCKER_USER and DOCKER_PASS to be defined before calling. + +# useful functions. +function docker_tag_exists() { + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${DOCKER_USER}'", "password": "'${DOCKER_PASS}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + curl --silent -f --head -lL https://hub.docker.com/v2/repositories/$1/tags/$2/ > /dev/null +} + +# pull the parent image from docker hub. +docker pull ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG} +UPSTREAM_ID=$(docker image inspect --format='{{index .Id}}' ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG}) +UPSTREAM_ID=${UPSTREAM_ID:7} + +# get the version number. +NEXTCLOUD_VERSION=$(docker inspect ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG} | jq -r '.[].Config.Env[] | select(match("^NEXTCLOUD_VERSION"))') +NEXTCLOUD_VERSION=${NEXTCLOUD_VERSION:18} +IMAGE_TAG=${NEXTCLOUD_VERSION}-${IMAGE_VARIANT} + +if docker_tag_exists ${IMAGE} ${IMAGE_TAG}; then + # nothing to do, the image already exists. + echo Image ${IMAGE}:${IMAGE_TAG} already exists. +else + # image doesn't exist we need build and push + echo Image ${IMAGE}:${IMAGE_TAG} does not exist. + echo "Building image(s)..." + docker build $1 \ + -t ${IMAGE}:${UPSTREAM_IMAGE_TAG} \ + -t ${IMAGE}:${IMAGE_TAG} + if [ $? == 0 ]; then + echo "Pushing image(s)..." + docker push ${IMAGE}:${IMAGE_TAG} + docker push ${IMAGE}:${UPSTREAM_IMAGE_TAG} + else + echo "The build operation failed." + echo "Please debug and try again." + fi +fi \ No newline at end of file diff --git a/fpm/20/push b/fpm/20/push deleted file mode 100755 index 52b6ae9..0000000 --- a/fpm/20/push +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -docker push bkraul/nextcloud:20-fpm - diff --git a/fpm/21/Dockerfile b/fpm/21/Dockerfile new file mode 100644 index 0000000..4ca4d64 --- /dev/null +++ b/fpm/21/Dockerfile @@ -0,0 +1,38 @@ +FROM nextcloud:21-fpm + +RUN set -ex \ + usermod -u 82 www-data; \ + groupmod -g 82 www-data; \ + usermod -g 82 www-data; \ + # for some reason this needs to be repeated. + usermod -u 82 www-data; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +RUN set -ex; \ + apt-get update; \ + apt-get install -y \ + libmagickcore-6.q16-3-extra; \ + rm -rf /var/lib/apt/lists/*; + +RUN set -ex; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y libsmbclient-dev; \ + pecl install smbclient; \ + docker-php-ext-enable smbclient; \ + # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* + +COPY redis.config.php /usr/src/nextcloud/config/redis.config.php diff --git a/fpm/21/build b/fpm/21/build new file mode 100755 index 0000000..230a1ea --- /dev/null +++ b/fpm/21/build @@ -0,0 +1,46 @@ +#!/bin/bash + +# define variables. +IMAGE_VARIANT=fpm +IMAGE_VERSION=21 +UPSTREAM_IMAGE=nextcloud +UPSTREAM_IMAGE_TAG=${IMAGE_VERSION}-${IMAGE_VARIANT} +IMAGE=bkraul/nextcloud + +# set username and password +# requires vars DOCKER_USER and DOCKER_PASS to be defined before calling. + +# useful functions. +function docker_tag_exists() { + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${DOCKER_USER}'", "password": "'${DOCKER_PASS}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + curl --silent -f --head -lL https://hub.docker.com/v2/repositories/$1/tags/$2/ > /dev/null +} + +# pull the parent image from docker hub. +docker pull ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG} +UPSTREAM_ID=$(docker image inspect --format='{{index .Id}}' ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG}) +UPSTREAM_ID=${UPSTREAM_ID:7} + +# get the version number. +NEXTCLOUD_VERSION=$(docker inspect ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG} | jq -r '.[].Config.Env[] | select(match("^NEXTCLOUD_VERSION"))') +NEXTCLOUD_VERSION=${NEXTCLOUD_VERSION:18} +IMAGE_TAG=${NEXTCLOUD_VERSION}-${IMAGE_VARIANT} + +if docker_tag_exists ${IMAGE} ${IMAGE_TAG}; then + # nothing to do, the image already exists. + echo Image ${IMAGE}:${IMAGE_TAG} already exists. +else + # image doesn't exist we need build and push + echo Image ${IMAGE}:${IMAGE_TAG} does not exist. + echo "Building image(s)..." + docker build $1 \ + -t ${IMAGE}:${UPSTREAM_IMAGE_TAG} \ + -t ${IMAGE}:${IMAGE_TAG} + if [ $? == 0 ]; then + echo "Pushing image(s)..." + docker push ${IMAGE}:${IMAGE_TAG} + docker push ${IMAGE}:${UPSTREAM_IMAGE_TAG} + else + echo "The build operation failed." + echo "Please debug and try again." + fi \ No newline at end of file diff --git a/fpm/21/redis.config.php b/fpm/21/redis.config.php new file mode 100644 index 0000000..b0cebe3 --- /dev/null +++ b/fpm/21/redis.config.php @@ -0,0 +1,8 @@ + '\OC\Memcache\Redis', + 'redis' => array( + 'host' => 'redis', + 'port' => 6379, + ), +);