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/parameters.yml b/ci/parameters.yml index 51ed615c5c..6e24244340 100644 --- a/ci/parameters.yml +++ b/ci/parameters.yml @@ -11,6 +11,3 @@ milestone: "2.5.x" build-name: "spring-boot" concourse-url: "https://ci.spring.io" task-timeout: 2h00m -registry-mirror-host: docker.repo.spring.io -registry-mirror-username: ((artifactory-username)) -registry-mirror-password: ((artifactory-password)) diff --git a/ci/pipeline.yml b/ci/pipeline.yml index bb73ced876..b246b4fa4d 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 artifactory-repo-put-params: &artifactory-repo-put-params @@ -80,10 +81,10 @@ anchors: gradle-publish-params: &gradle-publish-params GRADLE_PUBLISH_KEY: ((gradle-publish-key)) GRADLE_PUBLISH_SECRET: ((gradle-publish-secret)) - registry-mirror-vars: ®istry-mirror-vars - registry-mirror-host: ((registry-mirror-host)) - registry-mirror-username: ((registry-mirror-username)) - registry-mirror-password: ((registry-mirror-password)) + docker-hub-mirror-vars: &docker-hub-mirror-vars + docker-hub-mirror: ((docker-hub-mirror)) + docker-hub-mirror-username: ((docker-hub-mirror-username)) + docker-hub-mirror-password: ((docker-hub-mirror-password)) resource_types: - name: artifactory-resource type: registry-image @@ -241,7 +242,7 @@ jobs: image: ci-image vars: ci-image-name: ci-image - <<: *registry-mirror-vars + <<: *docker-hub-mirror-vars - task: build-ci-image-jdk11 privileged: true file: git-repo/ci/tasks/build-ci-image.yml @@ -249,7 +250,7 @@ jobs: image: ci-image-jdk11 vars: ci-image-name: ci-image-jdk11 - <<: *registry-mirror-vars + <<: *docker-hub-mirror-vars - task: build-ci-image-jdk17 privileged: true file: git-repo/ci/tasks/build-ci-image.yml @@ -257,7 +258,7 @@ jobs: image: ci-image-jdk17 vars: ci-image-name: ci-image-jdk17 - <<: *registry-mirror-vars + <<: *docker-hub-mirror-vars - in_parallel: - put: ci-image params: @@ -553,7 +554,7 @@ jobs: GITHUB_USERNAME: ((github-username)) GITHUB_TOKEN: ((github-ci-release-token)) vars: - <<: *registry-mirror-vars + <<: *docker-hub-mirror-vars - put: github-pre-release params: name: generated-changelog/tag @@ -584,7 +585,7 @@ jobs: GITHUB_USERNAME: ((github-username)) GITHUB_TOKEN: ((github-ci-release-token)) vars: - <<: *registry-mirror-vars + <<: *docker-hub-mirror-vars - put: github-pre-release params: name: generated-changelog/tag @@ -645,7 +646,7 @@ jobs: GITHUB_USERNAME: ((github-username)) GITHUB_TOKEN: ((github-ci-release-token)) vars: - <<: *registry-mirror-vars + <<: *docker-hub-mirror-vars - put: github-release params: name: generated-changelog/tag diff --git a/ci/tasks/build-ci-image.yml b/ci/tasks/build-ci-image.yml index 25228e848f..00f1804a44 100644 --- a/ci/tasks/build-ci-image.yml +++ b/ci/tasks/build-ci-image.yml @@ -6,9 +6,9 @@ image_resource: repository: concourse/oci-build-task tag: 0.9.1 registry_mirror: - host: ((registry-mirror-host)) - username: ((registry-mirror-username)) - password: ((registry-mirror-password)) + host: ((docker-hub-mirror)) + username: ((docker-hub-mirror-username)) + password: ((docker-hub-mirror-password)) inputs: - name: ci-images-git-repo outputs: @@ -18,6 +18,7 @@ caches: params: CONTEXT: ci-images-git-repo/ci/images DOCKERFILE: ci-images-git-repo/ci/images/((ci-image-name))/Dockerfile + REGISTRY_MIRRORS: ((docker-hub-mirror)) DOCKER_HUB_AUTH: ((docker-hub-auth)) run: path: /bin/sh 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 diff --git a/ci/tasks/generate-changelog.yml b/ci/tasks/generate-changelog.yml index 4927fbf86c..2186a259e5 100755 --- a/ci/tasks/generate-changelog.yml +++ b/ci/tasks/generate-changelog.yml @@ -6,9 +6,9 @@ image_resource: repository: springio/github-changelog-generator tag: '0.0.7' registry_mirror: - host: ((registry-mirror-host)) - username: ((registry-mirror-username)) - password: ((registry-mirror-password)) + host: ((docker-hub-mirror)) + username: ((docker-hub-mirror-username)) + password: ((docker-hub-mirror-password)) inputs: - name: git-repo - name: artifactory-repo