Skip to content

Commit cb56035

Browse files
committed
Setup docker config.json on CI when building project
1 parent caaef89 commit cb56035

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

ci/pipeline.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ anchors:
2020
DOCKER_HUB_MIRROR: ((docker-hub-mirror))
2121
DOCKER_HUB_USERNAME: ((docker-hub-username))
2222
DOCKER_HUB_PASSWORD: ((docker-hub-password))
23+
DOCKER_HUB_AUTH: ((docker-hub-auth))
2324
github-task-params: &github-task-params
2425
GITHUB_REPO: spring-boot
2526
GITHUB_ORGANIZATION: spring-projects

ci/tasks/build-project.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ params:
2020
run:
2121
path: bash
2222
args:
23-
- -ec
24-
- |
25-
source /docker-lib.sh
26-
start_docker $DOCKER_HUB_MIRROR
27-
${PWD}/git-repo/ci/scripts/build-project.sh
23+
- "-ec"
24+
- |
25+
mkdir -p /root/.docker
26+
cat > /root/.docker/config.json <<EOF
27+
{ "auths": { "https://index.docker.io/v1/": { "auth": "$DOCKER_HUB_AUTH" }}}
28+
EOF
29+
source /docker-lib.sh
30+
start_docker $DOCKER_HUB_MIRROR
31+
${PWD}/git-repo/ci/scripts/build-project.sh

0 commit comments

Comments
 (0)