From e3120a715e204bc3cb83b4d8410742bdfc47f8ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ma=CC=88der?= Date: Mon, 5 Mar 2018 14:35:11 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B3=20Allow=20variants=20from=20other?= =?UTF-8?q?=20source=20images?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile.ldap | 4 +++- build.sh | 16 ++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Dockerfile.ldap b/Dockerfile.ldap index 78fc332..5402eb7 100644 --- a/Dockerfile.ldap +++ b/Dockerfile.ldap @@ -1,5 +1,7 @@ +ARG DOCKER_ORG=ninech +ARG DOCKER_REPO=netbox ARG FROM_TAG=latest -FROM ninech/netbox:$FROM_TAG +FROM $DOCKER_ORG/$DOCKER_REPO:$FROM_TAG RUN pip install django_auth_ldap diff --git a/build.sh b/build.sh index 43df0b6..9133d19 100755 --- a/build.sh +++ b/build.sh @@ -39,13 +39,15 @@ if [ "${1}x" == "x" ] || [ "${1}" == "--help" ] || [ "${1}" == "-h" ]; then echo " Must be a tar.gz file of the source code." echo " Default: https://github.com///archive/\$BRANCH.tar.gz" echo " VARIANT The variant to build." - echo " When set the value will be used as a TAG suffix and for Dockerfile selection." - echo " The TAG being build must exist for the base variant and the variant Dockerfile" - echo " must start with the following two lines:" + echo " The value will be used as a suffix to the \$TAG and for the Dockerfile" + echo " selection. The TAG being build must exist for the base variant and" + echo " corresponding Dockerfile must start with the following lines:" + echo " ARG DOCKER_ORG=ninech" + echo " ARG DOCKER_REPOT=netbox" echo " ARG FROM_TAG=latest" - echo " FROM ninech/netbox:$FROM_TAG" - echo " Example: VARIANT=ldap will result in the tag 'latest-ldap' and the Dockerfile" - echo " 'Dockerfile.ldap' being used." + echo " FROM \$DOCKER_ORG/\$DOCKER_REPO:\$FROM_TAG" + echo " Example: VARIANT=ldap will result in the tag 'latest-ldap' and the" + echo " Dockerfile 'Dockerfile.ldap' being used." echo " Default: empty" if [ "${1}x" == "x" ]; then @@ -112,6 +114,8 @@ DOCKER_BUILD_ARGS=( --build-arg "FROM_TAG=${TAG}" --build-arg "BRANCH=${BRANCH}" --build-arg "URL=${URL}" + --build-arg "DOCKER_ORG=${DOCKER_ORG}" + --build-arg "DOCKER_REPO=${DOCKER_REPO}" ) if [ -z "$DRY_RUN" ]; then