diff --git a/README.md b/README.md index e6d7bd5..8d0c7c9 100644 --- a/README.md +++ b/README.md @@ -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. # 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 `27-fpm-alpine` and `27-fpm` version is **27.1.10** diff --git a/build b/build index a3d1e12..fb4f2b3 100755 --- a/build +++ b/build @@ -4,6 +4,8 @@ PUSH=${PUSH:-1} # use this as: FORCE=1 ./build ... in order to set the variable. default is 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 IMAGE_VERSION=$1 @@ -35,9 +37,15 @@ do 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 + # pull the parent image from docker hub, if it doesn't already exist locally. + LOCAL_EXISTS=$(docker images --format "{{.Repository}}:{{.Tag}}" | grep -x ${UPSTREAM_IMAGE}:${UPSTREAM_IMAGE_TAG}) + 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=${UPSTREAM_ID:7}