There seems to be an issue with docker hub build environment

Trying DOCKER_TAG instead of CACHE_TAG
master
mlan 2019-02-09 09:16:46 +01:00
parent 3f1f8c1987
commit e426cb03f6
2 changed files with 11 additions and 10 deletions

View File

@ -1,19 +1,20 @@
#!/bin/bash
# hooks/build
# $DOCKER_REPO and $CACHE_TAG are injected into the build environment
# $DOCKER_REPO and $DOCKER_TAG are injected into the build environment
echo "hooks/build called with IMAGE_NAME=${DOCKER_REPO}:${CACHE_TAG}, so we will run:"
echo "hooks/build called with IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG}, so we will run:"
printenv
case "${CACHE_TAG}" in
case "${DOCKER_TAG}" in
core) bld_target=kopano-core ;;
full) bld_target=kopano-full ;;
debugtools) bld_target=kopano-debugtools ;;
webapp) bld_target=kopano-webapp ;;
*)
echo "NOTHING since we do not know how to build with tag=${CACHE_TAG}"
echo "NOTHING since we do not know how to build with tag=${DOCKER_TAG}"
exit 1
;;
esac
echo "docker build --target $bld_target -t ${DOCKER_REPO}:${CACHE_TAG} ."
docker build --target $bld_target -t ${DOCKER_REPO}:${CACHE_TAG} .
echo "docker build --target $bld_target -t ${DOCKER_REPO}:${DOCKER_TAG} ."
docker build --target $bld_target -t ${DOCKER_REPO}:${DOCKER_TAG} .

View File

@ -5,17 +5,17 @@ version=$(assets/kopano-webaddr.sh -VV)
_docker_add_tags() {
local tag="$1"
echo "hooks/post_push called with IMAGE_NAME=${DOCKER_REPO}:${CACHE_TAG}, so we will use tag=$tag"
echo "hooks/post_push called with IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG}, so we will use tag=$tag"
docker tag $IMAGE_NAME $DOCKER_REPO:$tag
docker push $DOCKER_REPO:$tag
}
if [[ "$CACHE_TAG" == "full" ]]; then
if [[ "$DOCKER_TAG" == "full" ]]; then
_docker_add_tags latest
_docker_add_tags latest-full
_docker_add_tags ${version}
_docker_add_tags ${version}-full
else
_docker_add_tags latest-${CACHE_TAG}
_docker_add_tags ${version}-${CACHE_TAG}
_docker_add_tags latest-${DOCKER_TAG}
_docker_add_tags ${version}-${DOCKER_TAG}
fi