Added ability to use local upstream image (for when nextcloud is locally built).
This commit is contained in:
@@ -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}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user