diff --git a/circleci/docker-publish b/circleci/docker-publish index aa8cba4..a280ba7 100755 --- a/circleci/docker-publish +++ b/circleci/docker-publish @@ -20,7 +20,6 @@ check_hub_vars() { } push_hub_image() { - docker login -u $DOCKER_USER -p $DOCKER_PASS --email="$DOCKER_EMAIL" docker push $ORG/$REPO:$SHORT_SHA } @@ -54,6 +53,10 @@ if [ "$ECR_PUSH_ID" != "" ]; then check_ecr_vars fi +# dockerhub login. +# `FROM image` in Dockerfile is going to pull from DockerHub +docker login -u $DOCKER_USER -p $DOCKER_PASS --email="$DOCKER_EMAIL" + echo "Building docker image..." docker build -t $ORG/$REPO:$SHORT_SHA .