🐳 Allow variants from other source images

This commit is contained in:
Christian Mäder 2018-03-05 14:35:11 +01:00
parent 30a37511e2
commit e3120a715e
No known key found for this signature in database
GPG Key ID: 92FFD0A711F196BB
2 changed files with 13 additions and 7 deletions

View File

@ -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

View File

@ -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/<SRC_ORG>/<SRC_REPO>/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