allow registry to be set

This commit is contained in:
Myers Carpenter 2019-01-06 21:42:42 -05:00 committed by Nándor István Krácser
parent b8589dbbb8
commit 554ce3534a

View File

@ -4,17 +4,21 @@ set -euo pipefail
export PATH=$PATH:/kaniko/ export PATH=$PATH:/kaniko/
DOCKER_AUTH=`echo -n "${DOCKER_USERNAME}:${DOCKER_PASSWORD}" | base64` if [[ -n "${PLUGIN_USERNAME}" ]]; then
DOCKER_AUTH=`echo -n "${PLUGIN_USERNAME}:${PLUGIN_PASSWORD}" | base64`
REGISTRY=${PLUGIN_REGISTRY:-https://index.docker.io/v1/}
cat > /kaniko/.docker/config.json <<DOCKERJSON cat > /kaniko/.docker/config.json <<DOCKERJSON
{ {
"auths": { "auths": {
"https://index.docker.io/v1/": { "${REGISTRY}": {
"auth": "${DOCKER_AUTH}" "auth": "${DOCKER_AUTH}"
} }
} }
} }
DOCKERJSON DOCKERJSON
fi
DOCKERFILE=${PLUGIN_DOCKERFILE:-Dockerfile} DOCKERFILE=${PLUGIN_DOCKERFILE:-Dockerfile}
DESTINATION=${PLUGIN_REPO}:${PLUGIN_TAGS:-latest} DESTINATION=${PLUGIN_REPO}:${PLUGIN_TAGS:-latest}