Skip to content

Commit

Permalink
Login to dockerhub early for private image pulls (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohit authored Jun 9, 2017
1 parent c8e7e6c commit ccdc6a6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion circleci/docker-publish
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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 .

Expand Down

0 comments on commit ccdc6a6

Please sign in to comment.