From 90ecdad357e2f8291db7d0f0bd2635cc3e299844 Mon Sep 17 00:00:00 2001 From: ops Date: Sun, 2 Jun 2024 23:37:22 +0000 Subject: [PATCH] Revamped build process --- build | 102 ++++++++++++++++++ .../dockerfile/Dockerfile-fpm | 16 ++- build-common/dockerfile/Dockerfile-fpm-alpine | 28 +++++ .../redis}/redis.config.php | 0 fpm-alpine/16/Dockerfile | 22 ---- fpm-alpine/16/build | 6 -- fpm-alpine/16/push | 4 - fpm-alpine/17/Dockerfile | 22 ---- fpm-alpine/17/build | 6 -- fpm-alpine/17/push | 4 - fpm-alpine/17/redis.config.php | 8 -- fpm-alpine/18/Dockerfile | 21 ---- fpm-alpine/18/build | 6 -- fpm-alpine/18/push | 4 - fpm-alpine/18/redis.config.php | 8 -- fpm-alpine/19/Dockerfile | 21 ---- fpm-alpine/19/build | 47 -------- fpm-alpine/19/redis.config.php | 8 -- fpm-alpine/20/Dockerfile | 21 ---- fpm-alpine/20/build | 48 --------- fpm-alpine/20/redis.config.php | 8 -- fpm-alpine/21/Dockerfile | 21 ---- fpm-alpine/21/build | 48 --------- fpm-alpine/21/redis.config.php | 8 -- fpm/16/Dockerfile | 39 ------- fpm/16/build | 6 -- fpm/16/push | 4 - fpm/16/redis.config.php | 8 -- fpm/17/Dockerfile | 39 ------- fpm/17/build | 6 -- fpm/17/push | 4 - fpm/17/redis.config.php | 8 -- fpm/18/Dockerfile | 38 ------- fpm/18/build | 6 -- fpm/18/push | 4 - fpm/18/redis.config.php | 8 -- fpm/19/build | 47 -------- fpm/19/redis.config.php | 8 -- fpm/20/Dockerfile | 38 ------- fpm/20/build | 47 -------- fpm/20/redis.config.php | 8 -- fpm/21/Dockerfile | 38 ------- fpm/21/build | 46 -------- fpm/21/redis.config.php | 8 -- 44 files changed, 141 insertions(+), 756 deletions(-) create mode 100755 build rename fpm/19/Dockerfile => build-common/dockerfile/Dockerfile-fpm (63%) create mode 100644 build-common/dockerfile/Dockerfile-fpm-alpine rename {fpm-alpine/16 => build-common/redis}/redis.config.php (100%) delete mode 100644 fpm-alpine/16/Dockerfile delete mode 100755 fpm-alpine/16/build delete mode 100755 fpm-alpine/16/push delete mode 100644 fpm-alpine/17/Dockerfile delete mode 100755 fpm-alpine/17/build delete mode 100755 fpm-alpine/17/push delete mode 100644 fpm-alpine/17/redis.config.php delete mode 100644 fpm-alpine/18/Dockerfile delete mode 100755 fpm-alpine/18/build delete mode 100755 fpm-alpine/18/push delete mode 100644 fpm-alpine/18/redis.config.php delete mode 100644 fpm-alpine/19/Dockerfile delete mode 100755 fpm-alpine/19/build delete mode 100644 fpm-alpine/19/redis.config.php delete mode 100644 fpm-alpine/20/Dockerfile delete mode 100755 fpm-alpine/20/build delete mode 100644 fpm-alpine/20/redis.config.php delete mode 100644 fpm-alpine/21/Dockerfile delete mode 100755 fpm-alpine/21/build delete mode 100644 fpm-alpine/21/redis.config.php delete mode 100644 fpm/16/Dockerfile delete mode 100755 fpm/16/build delete mode 100755 fpm/16/push delete mode 100644 fpm/16/redis.config.php delete mode 100644 fpm/17/Dockerfile delete mode 100755 fpm/17/build delete mode 100755 fpm/17/push delete mode 100644 fpm/17/redis.config.php delete mode 100644 fpm/18/Dockerfile delete mode 100755 fpm/18/build delete mode 100755 fpm/18/push delete mode 100644 fpm/18/redis.config.php delete mode 100755 fpm/19/build delete mode 100644 fpm/19/redis.config.php delete mode 100644 fpm/20/Dockerfile delete mode 100755 fpm/20/build delete mode 100644 fpm/20/redis.config.php delete mode 100644 fpm/21/Dockerfile delete mode 100755 fpm/21/build delete mode 100644 fpm/21/redis.config.php diff --git a/build b/build new file mode 100755 index 0000000..7b60b34 --- /dev/null +++ b/build @@ -0,0 +1,102 @@ +#!/bin/bash + +# use this as: PUSH=0 ./build ... in order to set the variable. default is PUSH=1 +PUSH=${PUSH:-1} +FORCE=${FORCE:-0} + +if [ ! "$1" == "" ]; then + IMAGE_VERSION=$1 +else + echo "No Nextcloud version specified. Exiting (1)." + exit 1 +fi + +if [ ! "$2" == "" ]; then + VARIANTS=$2 +else + VARIANTS=("fpm" "fpm-alpine") +fi + +# 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 +} + +for item in "${!VARIANTS[@]}" +do + IMAGE_VARIANT=${VARIANTS[$item]} + UPSTREAM_IMAGE=nextcloud + UPSTREAM_IMAGE_TAG=${IMAGE_VERSION}-${IMAGE_VARIANT} + IMAGE=bkraul/nextcloud + + echo "Building Nextcloud ${IMAGE_VERSION}, variant: ${IMAGE_VARIANT}..." + + # pull the parent image from docker hub. + echo "Pulling upstream image ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG}..." + docker pull ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG} > /dev/null + 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. + echo "----------------------------" + echo "FORCE: $FORCE" + if [ $FORCE == 0 ]; then continue; fi + fi + + # determine the common files to use. + # Dockerfile + DOCKERFILE_DIR="./build-common/dockerfile" + DOCKERFILE="" + if [ -f "${DOCKERFILE_DIR}/Dockerfile" ]; then DOCKERFILE="${DOCKERFILE_DIR}/Dockerfile"; fi + if [ -f "${DOCKERFILE_DIR}/Dockerfile-${IMAGE_VERSION}" ]; then DOCKERFILE="${DOCKERFILE_DIR}/Dockerfile-${IMAGE_VERSION}"; fi + if [ -f "${DOCKERFILE_DIR}/Dockerfile-${IMAGE_VARIANT}" ]; then echo "Image variant"; DOCKERFILE="${DOCKERFILE_DIR}/Dockerfile-${IMAGE_VARIANT}"; fi + if [ -f "${DOCKERFILE_DIR}/Dockerfile-${IMAGE_VARIANT}-${IMAGE_VERSION}" ]; then DOCKERFILE="${DOCKERFILE_DIR}/Dockerfile-${IMAGE_VARIANT}-${IMAGE_VERSION}"; fi + + # if no valid Dockerfile is found, we abort current build and go to next variant if available. + if [ "${DOCKERFILE}" = "" ]; then echo "No valid Dockerfile found."; continue; fi + + # image doesn't exist we need build and push + echo Image ${IMAGE}:${IMAGE_TAG} does not exist. + echo "Building image(s)..." + #--file ${DOCKERFILE} \ + docker build \ + --file ${DOCKERFILE} \ + --no-cache \ + -t ${IMAGE}:${UPSTREAM_IMAGE_TAG} \ + -t ${IMAGE}:${IMAGE_TAG} \ + --build-arg BASE_IMAGE="${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG}" \ + --progress plain \ + ./build-common + + if [ $? == 0 ]; then + # don't push if specified so (continue the variant loop). + if [ ${PUSH} == 0 ]; then + echo "----------------------------" + continue; + fi + + 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 + echo "----------------------------" +done + + + + + + diff --git a/fpm/19/Dockerfile b/build-common/dockerfile/Dockerfile-fpm similarity index 63% rename from fpm/19/Dockerfile rename to build-common/dockerfile/Dockerfile-fpm index 5b2f354..8c30e6c 100644 --- a/fpm/19/Dockerfile +++ b/build-common/dockerfile/Dockerfile-fpm @@ -1,4 +1,8 @@ -FROM nextcloud:19-fpm +# retrieve the base image (default to latest). +ARG BASE_IMAGE="nextcloud:29-fpm" + +FROM ${BASE_IMAGE} +LABEL org.opencontainers.image.authors="Belman Kraul " RUN set -ex \ usermod -u 82 www-data; \ @@ -11,8 +15,7 @@ RUN set -ex \ RUN set -ex; \ apt-get update; \ - apt-get install -y \ - libmagickcore-6.q16-3-extra; \ + apt-get install -y libmagickcore-6.q16-3-extra libsmbclient; \ rm -rf /var/lib/apt/lists/*; RUN set -ex; \ @@ -21,7 +24,9 @@ RUN set -ex; \ 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-get install -y libbz2-dev; \ + docker-php-ext-install bz2; \ + # 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 \ @@ -35,4 +40,5 @@ RUN set -ex; \ 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 +# copy the redis configuration file. +COPY redis/redis.config.php /usr/src/nextcloud/config/redis.config.php diff --git a/build-common/dockerfile/Dockerfile-fpm-alpine b/build-common/dockerfile/Dockerfile-fpm-alpine new file mode 100644 index 0000000..9d92548 --- /dev/null +++ b/build-common/dockerfile/Dockerfile-fpm-alpine @@ -0,0 +1,28 @@ +# retrieve the base image (default to latest). +ARG BASE_IMAGE="nextcloud:29-fpm-alpine" + +FROM ${BASE_IMAGE} +LABEL org.opencontainers.image.authors="Belman Kraul " + +RUN set -ex; \ + PHP_VER=${PHP_VERSION:0:3} && PHP_VER=${PHP_VER//.} && \ + apk add --no-cache --virtual .build-deps \ + autoconf \ + automake \ + file \ + g++ \ + gcc \ + make \ + php${PHP_VER}-dev \ + re2c \ + samba-dev \ + zlib-dev \ + bzip2-dev; \ + apk add --no-cache libsmbclient; \ + pecl install smbclient; \ + docker-php-ext-enable smbclient; \ + docker-php-ext-install bz2; \ + apk add --no-cache imagemagick imagemagick-svg; \ + apk del .build-deps + +COPY redis/redis.config.php /usr/src/nextcloud/config/redis.config.php diff --git a/fpm-alpine/16/redis.config.php b/build-common/redis/redis.config.php similarity index 100% rename from fpm-alpine/16/redis.config.php rename to build-common/redis/redis.config.php diff --git a/fpm-alpine/16/Dockerfile b/fpm-alpine/16/Dockerfile deleted file mode 100644 index 9b35f3f..0000000 --- a/fpm-alpine/16/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM nextcloud:16-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 add --no-cache sudo; \ - apk del .build-deps - -COPY redis.config.php /usr/src/nextcloud/config/redis.config.php diff --git a/fpm-alpine/16/build b/fpm-alpine/16/build deleted file mode 100755 index d7891c0..0000000 --- a/fpm-alpine/16/build +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -docker pull nextcloud:16-fpm-alpine -docker build $1\ - -t bkraul/nextcloud:16-fpm-alpine \ - . diff --git a/fpm-alpine/16/push b/fpm-alpine/16/push deleted file mode 100755 index 8d5750a..0000000 --- a/fpm-alpine/16/push +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -docker push bkraul/nextcloud:16-fpm-alpine - diff --git a/fpm-alpine/17/Dockerfile b/fpm-alpine/17/Dockerfile deleted file mode 100644 index 70e61bb..0000000 --- a/fpm-alpine/17/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM nextcloud:17-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 add --no-cache sudo; \ - apk del .build-deps - -COPY redis.config.php /usr/src/nextcloud/config/redis.config.php diff --git a/fpm-alpine/17/build b/fpm-alpine/17/build deleted file mode 100755 index cdd7303..0000000 --- a/fpm-alpine/17/build +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -docker pull nextcloud:17-fpm-alpine -docker build $1\ - -t bkraul/nextcloud:17-fpm-alpine \ - . diff --git a/fpm-alpine/17/push b/fpm-alpine/17/push deleted file mode 100755 index 9ea97f6..0000000 --- a/fpm-alpine/17/push +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -docker push bkraul/nextcloud:17-fpm-alpine - diff --git a/fpm-alpine/17/redis.config.php b/fpm-alpine/17/redis.config.php deleted file mode 100644 index b0cebe3..0000000 --- a/fpm-alpine/17/redis.config.php +++ /dev/null @@ -1,8 +0,0 @@ - '\OC\Memcache\Redis', - 'redis' => array( - 'host' => 'redis', - 'port' => 6379, - ), -); diff --git a/fpm-alpine/18/Dockerfile b/fpm-alpine/18/Dockerfile deleted file mode 100644 index 670ab89..0000000 --- a/fpm-alpine/18/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM nextcloud:18-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/18/build b/fpm-alpine/18/build deleted file mode 100755 index 6adc830..0000000 --- a/fpm-alpine/18/build +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -docker pull nextcloud:18-fpm-alpine -docker build $1\ - -t bkraul/nextcloud:18-fpm-alpine \ - . diff --git a/fpm-alpine/18/push b/fpm-alpine/18/push deleted file mode 100755 index 6298c9c..0000000 --- a/fpm-alpine/18/push +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -docker push bkraul/nextcloud:18-fpm-alpine - diff --git a/fpm-alpine/18/redis.config.php b/fpm-alpine/18/redis.config.php deleted file mode 100644 index b0cebe3..0000000 --- a/fpm-alpine/18/redis.config.php +++ /dev/null @@ -1,8 +0,0 @@ - '\OC\Memcache\Redis', - 'redis' => array( - 'host' => 'redis', - 'port' => 6379, - ), -); diff --git a/fpm-alpine/19/Dockerfile b/fpm-alpine/19/Dockerfile deleted file mode 100644 index ca156e5..0000000 --- a/fpm-alpine/19/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM nextcloud:19-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/19/build b/fpm-alpine/19/build deleted file mode 100755 index c3ec7f7..0000000 --- a/fpm-alpine/19/build +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -# 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/redis.config.php b/fpm-alpine/19/redis.config.php deleted file mode 100644 index b0cebe3..0000000 --- a/fpm-alpine/19/redis.config.php +++ /dev/null @@ -1,8 +0,0 @@ - '\OC\Memcache\Redis', - 'redis' => array( - 'host' => 'redis', - 'port' => 6379, - ), -); diff --git a/fpm-alpine/20/Dockerfile b/fpm-alpine/20/Dockerfile deleted file mode 100644 index 83a32ef..0000000 --- a/fpm-alpine/20/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM nextcloud:20-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/20/build b/fpm-alpine/20/build deleted file mode 100755 index 9e0e7ac..0000000 --- a/fpm-alpine/20/build +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# 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/redis.config.php b/fpm-alpine/20/redis.config.php deleted file mode 100644 index b0cebe3..0000000 --- a/fpm-alpine/20/redis.config.php +++ /dev/null @@ -1,8 +0,0 @@ - '\OC\Memcache\Redis', - 'redis' => array( - 'host' => 'redis', - 'port' => 6379, - ), -); diff --git a/fpm-alpine/21/Dockerfile b/fpm-alpine/21/Dockerfile deleted file mode 100644 index 10d6d8f..0000000 --- a/fpm-alpine/21/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -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 deleted file mode 100755 index 4da24ba..0000000 --- a/fpm-alpine/21/build +++ /dev/null @@ -1,48 +0,0 @@ -#!/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 deleted file mode 100644 index b0cebe3..0000000 --- a/fpm-alpine/21/redis.config.php +++ /dev/null @@ -1,8 +0,0 @@ - '\OC\Memcache\Redis', - 'redis' => array( - 'host' => 'redis', - 'port' => 6379, - ), -); diff --git a/fpm/16/Dockerfile b/fpm/16/Dockerfile deleted file mode 100644 index fc6ff64..0000000 --- a/fpm/16/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM nextcloud:16-fpm -MAINTAINER Belman Kraul - -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/16/build b/fpm/16/build deleted file mode 100755 index 121e09d..0000000 --- a/fpm/16/build +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -docker pull nextcloud:16-fpm -docker build $1\ - -t bkraul/nextcloud:16-fpm \ - . diff --git a/fpm/16/push b/fpm/16/push deleted file mode 100755 index 9d900e4..0000000 --- a/fpm/16/push +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -docker push bkraul/nextcloud:16-fpm - diff --git a/fpm/16/redis.config.php b/fpm/16/redis.config.php deleted file mode 100644 index b0cebe3..0000000 --- a/fpm/16/redis.config.php +++ /dev/null @@ -1,8 +0,0 @@ - '\OC\Memcache\Redis', - 'redis' => array( - 'host' => 'redis', - 'port' => 6379, - ), -); diff --git a/fpm/17/Dockerfile b/fpm/17/Dockerfile deleted file mode 100644 index a3e7271..0000000 --- a/fpm/17/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM nextcloud:17-fpm -MAINTAINER Belman Kraul - -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/17/build b/fpm/17/build deleted file mode 100755 index b7b52d3..0000000 --- a/fpm/17/build +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -docker pull nextcloud:17-fpm -docker build $1 \ - -t bkraul/nextcloud:17-fpm \ - . diff --git a/fpm/17/push b/fpm/17/push deleted file mode 100755 index 2d83117..0000000 --- a/fpm/17/push +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -docker push bkraul/nextcloud:17-fpm - diff --git a/fpm/17/redis.config.php b/fpm/17/redis.config.php deleted file mode 100644 index b0cebe3..0000000 --- a/fpm/17/redis.config.php +++ /dev/null @@ -1,8 +0,0 @@ - '\OC\Memcache\Redis', - 'redis' => array( - 'host' => 'redis', - 'port' => 6379, - ), -); diff --git a/fpm/18/Dockerfile b/fpm/18/Dockerfile deleted file mode 100644 index 8b7e9da..0000000 --- a/fpm/18/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -FROM nextcloud:18-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 --allow-unauthenticated update; \ - apt-get --allow-unauthenticated 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/18/build b/fpm/18/build deleted file mode 100755 index f82456a..0000000 --- a/fpm/18/build +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -docker pull nextcloud:18-fpm -docker build $1\ - -t bkraul/nextcloud:18-fpm \ - . diff --git a/fpm/18/push b/fpm/18/push deleted file mode 100755 index 2ef566a..0000000 --- a/fpm/18/push +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -docker push bkraul/nextcloud:18-fpm - diff --git a/fpm/18/redis.config.php b/fpm/18/redis.config.php deleted file mode 100644 index b0cebe3..0000000 --- a/fpm/18/redis.config.php +++ /dev/null @@ -1,8 +0,0 @@ - '\OC\Memcache\Redis', - 'redis' => array( - 'host' => 'redis', - 'port' => 6379, - ), -); diff --git a/fpm/19/build b/fpm/19/build deleted file mode 100755 index 5ff70f5..0000000 --- a/fpm/19/build +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -# 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/redis.config.php b/fpm/19/redis.config.php deleted file mode 100644 index b0cebe3..0000000 --- a/fpm/19/redis.config.php +++ /dev/null @@ -1,8 +0,0 @@ - '\OC\Memcache\Redis', - 'redis' => array( - 'host' => 'redis', - 'port' => 6379, - ), -); diff --git a/fpm/20/Dockerfile b/fpm/20/Dockerfile deleted file mode 100644 index 95120bf..0000000 --- a/fpm/20/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -FROM nextcloud:20-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/20/build b/fpm/20/build deleted file mode 100755 index 8b01ddb..0000000 --- a/fpm/20/build +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -# 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/redis.config.php b/fpm/20/redis.config.php deleted file mode 100644 index b0cebe3..0000000 --- a/fpm/20/redis.config.php +++ /dev/null @@ -1,8 +0,0 @@ - '\OC\Memcache\Redis', - 'redis' => array( - 'host' => 'redis', - 'port' => 6379, - ), -); diff --git a/fpm/21/Dockerfile b/fpm/21/Dockerfile deleted file mode 100644 index 4ca4d64..0000000 --- a/fpm/21/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -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 deleted file mode 100755 index 230a1ea..0000000 --- a/fpm/21/build +++ /dev/null @@ -1,46 +0,0 @@ -#!/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 deleted file mode 100644 index b0cebe3..0000000 --- a/fpm/21/redis.config.php +++ /dev/null @@ -1,8 +0,0 @@ - '\OC\Memcache\Redis', - 'redis' => array( - 'host' => 'redis', - 'port' => 6379, - ), -);