Skip to content

Commit ccdc6a6

Browse files
authored
Login to dockerhub early for private image pulls (#28)
1 parent c8e7e6c commit ccdc6a6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

circleci/docker-publish

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ check_hub_vars() {
2020
}
2121

2222
push_hub_image() {
23-
docker login -u $DOCKER_USER -p $DOCKER_PASS --email="$DOCKER_EMAIL"
2423
docker push $ORG/$REPO:$SHORT_SHA
2524
}
2625

@@ -54,6 +53,10 @@ if [ "$ECR_PUSH_ID" != "" ]; then
5453
check_ecr_vars
5554
fi
5655

56+
# dockerhub login.
57+
# `FROM image` in Dockerfile is going to pull from DockerHub
58+
docker login -u $DOCKER_USER -p $DOCKER_PASS --email="$DOCKER_EMAIL"
59+
5760
echo "Building docker image..."
5861
docker build -t $ORG/$REPO:$SHORT_SHA .
5962

0 commit comments

Comments
 (0)