Added ability to use local upstream image (for when nextcloud is locally built).

This commit is contained in:
bkraul 2024-06-09 22:43:27 +00:00
parent 767bed3097
commit f629ea8368
2 changed files with 12 additions and 4 deletions

View File

@ -15,7 +15,7 @@ This image adds built-in support for the following features:
* ImageMagick: (The `fpm-alpine` image does not natively support any image formats (including the needed SVG format), due to it missing `imagemagick` package). This image corrects that. * ImageMagick: (The `fpm-alpine` image does not natively support any image formats (including the needed SVG format), due to it missing `imagemagick` package). This image corrects that.
# Current Versions # Current Versions
The current `28-fpm-alpine` and `28-fpm` version is **29.0.1**\ The current `29-fpm-alpine` and `29-fpm` version is **29.0.2**\
The current `28-fpm-alpine` and `28-fpm` version is **28.0.6**\ The current `28-fpm-alpine` and `28-fpm` version is **28.0.6**\
The current `27-fpm-alpine` and `27-fpm` version is **27.1.10** The current `27-fpm-alpine` and `27-fpm` version is **27.1.10**

14
build
View File

@ -4,6 +4,8 @@
PUSH=${PUSH:-1} PUSH=${PUSH:-1}
# use this as: FORCE=1 ./build ... in order to set the variable. default is FORCE=0 # use this as: FORCE=1 ./build ... in order to set the variable. default is FORCE=0
FORCE=${FORCE:-0} FORCE=${FORCE:-0}
# use this as: USE_LOCAL=1 ./build ... in order to set the variable. default is USE_LOCAL=0
USE_LOCAL=${USE_LOCAL:-0}
if [ ! "$1" == "" ]; then if [ ! "$1" == "" ]; then
IMAGE_VERSION=$1 IMAGE_VERSION=$1
@ -35,9 +37,15 @@ do
echo "Building Nextcloud ${IMAGE_VERSION}, variant: ${IMAGE_VARIANT}..." echo "Building Nextcloud ${IMAGE_VERSION}, variant: ${IMAGE_VARIANT}..."
# pull the parent image from docker hub. # pull the parent image from docker hub, if it doesn't already exist locally.
echo "Pulling upstream image ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG}..." LOCAL_EXISTS=$(docker images --format "{{.Repository}}:{{.Tag}}" | grep -x ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG})
docker pull ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG} > /dev/null if [[ $FORCE_LOCAL == 1 && $LOCAL_EXISTS != "" ]]; then
echo "Using local image ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG}..."
else
echo "Pulling upstream image ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG}..."
docker pull ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG} > /dev/null
fi
UPSTREAM_ID=$(docker image inspect --format='{{index .Id}}' ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG}) UPSTREAM_ID=$(docker image inspect --format='{{index .Id}}' ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG})
UPSTREAM_ID=${UPSTREAM_ID:7} UPSTREAM_ID=${UPSTREAM_ID:7}