-
Notifications
You must be signed in to change notification settings - Fork 513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please add support for GOPROXY build-arg #315
Comments
I'm not sure I understand what you're asking for -- what concrete change are you suggesting we make? As-is, I don't believe there's anything preventing you from using |
Hi! 👋 You just can use Or:
In your Dockerfile? |
Yep, both of those should work just fine.
|
I want In particular, build-args do not get captured in the resulting layers, which is appropriate for GOPROXY, and do not affect the resulting container - they're purely a build-time parameter. Conversely, there is no I consume (rebuild locally) many golang-based upstream projects that are built FROM the standard golang library images. It would be a shame for me (and anyone else that needs to not use the default proxy for some reason) to have to patch every one of those downstream Dockerfiles to add |
Right, but if that's something you want for builds of your image, the |
To put that another way, if we add |
Oh you're right - build-args aren't perserved/inherited (that's kind of the point). Sorry, I should have verified that first :/ Closing this unimplementable feature request. |
Aha, reopening. I needed to use Please add the following to the golang dockerfile:
|
While I don't want to introduce unexpected "magic" that will skew users expectations for how Docker images work. Without being able to control if and when they trigger, Assuming they were added to golang, then this contrived dockerfile would have to redo the apt layer when the user has to change one of the build-args that really only affects the go build line
|
GOPROXY
is very much likehttp_proxy
and is expected to be used/set by the build environment, not by the source project. Please addARG GOPROXY
to the standard golang Dockerfiles >= 1.13, so this value may be provided externally during docker-based golang builds.Note that there are actually several relevant environment variables, so we may as well support all of them at the same time. I think the build-args we should add are:
GOPROXY
,GONOPROXY
,GOPRIVATE
,GOSUMDB
,GONOSUMDB
.Note also that I'm not suggesting we change any upstream defaults, only that we provide the ability to configure these values when appropriate (unlike #303, for example).
(I think this is technically a trivial/obvious edit, but let me know if it would be easier if I provided a concrete PR.)
The text was updated successfully, but these errors were encountered: