diff --git a/.github/workflows/registry.yml b/.github/workflows/registry.yml index 6015b3ed8..28080e020 100644 --- a/.github/workflows/registry.yml +++ b/.github/workflows/registry.yml @@ -57,7 +57,7 @@ jobs: - name: Build & Pushing vela-core for ACR run: | - docker build -t kubevela-registry.cn-hangzhou.cr.aliyuncs.com/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }} . + docker build --build-arg GOPROXY=https://proxy.golang.org -t kubevela-registry.cn-hangzhou.cr.aliyuncs.com/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }} . docker push kubevela-registry.cn-hangzhou.cr.aliyuncs.com/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }} - uses: docker/build-push-action@v2 name: Build & Pushing vela-core for Dockerhub and GHCR @@ -72,13 +72,14 @@ jobs: build-args: | GITVERSION=git-${{ steps.vars.outputs.git_revision }} VERSION=${{ steps.get_version.outputs.VERSION }} + GOPROXY=https://proxy.golang.org tags: |- docker.io/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }} ghcr.io/${{ github.repository }}/vela-core:${{ steps.get_version.outputs.VERSION }} - name: Build & Pushing vela-apiserver for ACR run: | - docker build -t kubevela-registry.cn-hangzhou.cr.aliyuncs.com/oamdev/vela-apiserver:${{ steps.get_version.outputs.VERSION }} -f Dockerfile.apiserver . + docker build --build-arg GOPROXY=https://proxy.golang.org -t kubevela-registry.cn-hangzhou.cr.aliyuncs.com/oamdev/vela-apiserver:${{ steps.get_version.outputs.VERSION }} -f Dockerfile.apiserver . docker push kubevela-registry.cn-hangzhou.cr.aliyuncs.com/oamdev/vela-apiserver:${{ steps.get_version.outputs.VERSION }} - uses: docker/build-push-action@v2 name: Build & Pushing vela-apiserver for Dockerhub and GHCR @@ -93,13 +94,14 @@ jobs: build-args: | GITVERSION=git-${{ steps.vars.outputs.git_revision }} VERSION=${{ steps.get_version.outputs.VERSION }} + GOPROXY=https://proxy.golang.org tags: |- docker.io/oamdev/vela-apiserver:${{ steps.get_version.outputs.VERSION }} ghcr.io/${{ github.repository }}/vela-apiserver:${{ steps.get_version.outputs.VERSION }} - name: Build & Pushing vela runtime rollout for ACR run: | - docker build -t kubevela-registry.cn-hangzhou.cr.aliyuncs.com/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }} . + docker build --build-arg GOPROXY=https://proxy.golang.org -t kubevela-registry.cn-hangzhou.cr.aliyuncs.com/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }} . docker push kubevela-registry.cn-hangzhou.cr.aliyuncs.com/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }} - uses: docker/build-push-action@v2 name: Build & Pushing runtime rollout for Dockerhub and GHCR @@ -114,6 +116,7 @@ jobs: build-args: | GITVERSION=git-${{ steps.vars.outputs.git_revision }} VERSION=${{ steps.get_version.outputs.VERSION }} + GOPROXY=https://proxy.golang.org tags: |- docker.io/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }} ghcr.io/${{ github.repository }}/vela-rollout:${{ steps.get_version.outputs.VERSION }} diff --git a/Dockerfile b/Dockerfile index bda49fa96..e944c0b84 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ COPY go.mod go.mod COPY go.sum go.sum # It's a proxy for CN developer, please unblock it if you have network issue +ARG GOPROXY ENV GOPROXY=${GOPROXY:-https://goproxy.cn} # cache deps before building and copying source so that we don't need to re-download as much