From 902dd0baf588a7c74c6f2064dc3aaf66c69db969 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Fri, 19 Nov 2021 11:33:37 -0800 Subject: [PATCH] Use local docker mirror for test containers See gh-24343 --- ci/images/docker-lib.sh | 8 ++------ ci/pipeline.yml | 1 + ci/tasks/build-project.yml | 3 ++- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ci/images/docker-lib.sh b/ci/images/docker-lib.sh index bcc0f33a01..eac9c2eee9 100644 --- a/ci/images/docker-lib.sh +++ b/ci/images/docker-lib.sh @@ -68,12 +68,8 @@ start_docker() { server_args="${server_args}" - for registry in $3; do - server_args="${server_args} --insecure-registry ${registry}" - done - - if [ -n "$4" ]; then - server_args="${server_args} --registry-mirror $4" + if [ -n "$1" ]; then + server_args="${server_args} --registry-mirror https://$1" fi try_start() { diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 735a4365ec..44cd5360cc 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -39,6 +39,7 @@ anchors: file: git-repo/ci/tasks/build-project.yml params: BRANCH: ((branch)) + DOCKER_HUB_MIRROR: ((docker-hub-mirror)) <<: *gradle-enterprise-task-params <<: *docker-hub-task-params run-system-tests-task-params: &run-system-tests-task-params diff --git a/ci/tasks/build-project.yml b/ci/tasks/build-project.yml index e6c296c49a..b3e050d189 100644 --- a/ci/tasks/build-project.yml +++ b/ci/tasks/build-project.yml @@ -15,11 +15,12 @@ params: GRADLE_ENTERPRISE_CACHE_USERNAME: GRADLE_ENTERPRISE_CACHE_PASSWORD: GRADLE_ENTERPRISE_URL: https://ge.spring.io + DOCKER_HUB_MIRROR: run: path: bash args: - -ec - | source /docker-lib.sh - start_docker + start_docker $DOCKER_HUB_MIRROR ${PWD}/git-repo/ci/scripts/build-project.sh