Added a bit more automation to build processes (only supported versions)
This commit is contained in:
@@ -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
|
||||
Executable
+48
@@ -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
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
$CONFIG = array (
|
||||
'memcache.locking' => '\OC\Memcache\Redis',
|
||||
'redis' => array(
|
||||
'host' => 'redis',
|
||||
'port' => 6379,
|
||||
),
|
||||
);
|
||||
Reference in New Issue
Block a user