Skip to content

fix(docker): update GOPROXY setting and simplify go mod download command - #309

Merged
wanjunlei merged 1 commit into
kubesphere:masterfrom
Gentleelephant:release-2.7-update-ci
Jun 22, 2026
Merged

fix(docker): update GOPROXY setting and simplify go mod download command#309
wanjunlei merged 1 commit into
kubesphere:masterfrom
Gentleelephant:release-2.7-update-ci

Conversation

@Gentleelephant

Copy link
Copy Markdown
Collaborator
  • Change GOPROXY argument value to "https://proxy.golang.org,direct"
  • Set GOPROXY as environment variable inside Dockerfiles
  • Remove explicit GOPROXY usage in "go mod download" commands
  • Use capital AS for Docker build stage aliases
  • Simplify build command by removing GOPROXY prefix in operator DockerfileRUN command

- Change GOPROXY argument value to "https://proxy.golang.org,direct"
- Set GOPROXY as environment variable inside Dockerfiles
- Remove explicit GOPROXY usage in "go mod download" commands
- Use capital AS for Docker build stage aliases
- Simplify build command by removing GOPROXY prefix in operator DockerfileRUN command

Signed-off-by: Gentleelephant <1132960613@qq.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the default GOPROXY to 'https://proxy.golang.org,direct' and refactors the Dockerfiles for both the notification manager and operator to simplify the build process. The feedback points out that adding 'ENV GOPROXY=${GOPROXY}' is redundant because the 'ARG' instruction already makes the variable available to subsequent build steps, so the 'ENV' instruction can be safely removed.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines 4 to +5
ARG GOPROXY
ENV GOPROXY=${GOPROXY}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The ENV GOPROXY=${GOPROXY} instruction is redundant. In Docker, any ARG declared within a build stage (such as ARG GOPROXY on line 4) is automatically available as an environment variable to all subsequent RUN instructions in that stage. Since GOPROXY is only needed during the build phase (for go mod download and go build), we can safely remove the ENV instruction to keep the Dockerfile cleaner and avoid persisting the build-time proxy configuration in the builder stage's metadata.

ARG GOPROXY

Comment thread cmd/operator/Dockerfile
Comment on lines 4 to +5
ARG GOPROXY
ENV GOPROXY=${GOPROXY}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The ENV GOPROXY=${GOPROXY} instruction is redundant. In Docker, any ARG declared within a build stage (such as ARG GOPROXY on line 4) is automatically available as an environment variable to all subsequent RUN instructions in that stage. Since GOPROXY is only needed during the build phase (for go mod download and go build), we can safely remove the ENV instruction to keep the Dockerfile cleaner and avoid persisting the build-time proxy configuration in the builder stage's metadata.

ARG GOPROXY

@Gentleelephant

Copy link
Copy Markdown
Collaborator Author

/cc @wanjunlei

@wanjunlei
wanjunlei merged commit 88ac441 into kubesphere:master Jun 22, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants