Skip to content

Propgate GOPROXY value to build-image/Dockerfile #2741

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

Merged
merged 2 commits into from
Jun 19, 2020

Conversation

alvinlin123
Copy link
Contributor

What this PR does:

Propagate configured GOPROXY value to build-image/Dockerfile so that we can build the code inside network that disallow access to default Go proxy server.

Which issue(s) this PR fixes:
Fixes #2740

Checklist

  • [Not applicable ] Tests updated
    • I have tested the build still works on a vanilla Ubuntu box.
    • I have tested my change works behind my company's network.
  • [ Not applicable] Documentation added
  • [ Done] CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
Signed-off-by: Alvin Lin <alvinlin@amazon.com>
@alvinlin123 alvinlin123 force-pushed the go-proxy-flag-during-build branch from 2064bec to b70bd03 Compare June 18, 2020 01:50
@pstibrany
Copy link
Contributor

pstibrany commented Jun 18, 2020

Thank you. Alternatively, since we have updated build image with go1.14, we can also update go.mod file, which will then automatically use vendor directory instead of using modules. This is the direction we plan to go. Do you want to give it a try and update PR with this change? (To clarify: I am suggesting changing go directive in go.mod to 1.14, which then triggers this behaviour)

@alvinlin123
Copy link
Contributor Author

alvinlin123 commented Jun 18, 2020

HI @pstibrany thanks for the comment. I just tried to change go.mod to 1.14, but still got the GOPROXY problem. I guess this is because the problem is still there because when building hugo it runs some go get command? Sorry I am new to Go ecosystem and is not really familiar with the build system :)

The error I am getting is

Step 7/23 : RUN git clone https://github.com/gohugoio/hugo.git --branch ${HUGO_VERSION} --depth 1 &&    cd hugo  && go install --tags extended && cd ../ &&     rm -rf hugo/ && rm -rf /go/pkg /go/src
 ---> Running in 774a1944d764
Cloning into 'hugo'...
Note: checking out '8a7ef3cf4ee3c65d4edba17b1608c770b6da1673'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

go: github.com/BurntSushi/locker@v0.0.0-20171006230638-a6e239ea1c69: Get "https://proxy.golang.org/github.com/%21burnt%21sushi/locker/@v/v0.0.0-20171006230638-a6e239ea1c69.mod": x509: certificate is valid for chalupa-dns-sinkhole.corp.amazon.com, not proxy.golang.org

The certificate does not match error is because my company's internal network redirect proxy.golang.org to some blackhole server.

@pstibrany
Copy link
Contributor

pstibrany commented Jun 18, 2020

I see, yes you're right that building the build-image needs to access the proxy as well. Propagating GOPROXY setting seems like best option then.

Copy link
Contributor

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

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

Thanks!

Signed-off-by: Alvin Lin <alvinlin@amazon.com>
@alvinlin123 alvinlin123 force-pushed the go-proxy-flag-during-build branch from 4f522c5 to 3d51040 Compare June 18, 2020 07:21
@alvinlin123
Copy link
Contributor Author

What is the process of getting the PR merged? I don't believe I can, nor should merge it myself right?

@pstibrany
Copy link
Contributor

What is the process of getting the PR merged? I don't believe I can, nor should merge it myself right?

No, you cannot merge it yourself. In Cortex, we have a rule that 2 maintainers need to approve the PR before merging. One more approval is needed, I'm sure someone will take a look at it very soon.

Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

LGTM

@pracucci pracucci merged commit 1775e32 into cortexproject:master Jun 19, 2020
alvinlin123 added a commit that referenced this pull request Jul 11, 2024
I can't believe this day would come, but I am stepping down as Cortex maintainer because I no longer have capacity to give Cortex the love it needs anymore. Also, Cortex is in good hands with existing maintainers from diverse set of companies.

It's been a fun ride. I still remember my [first Cortex PR](#2741) that allows me to build Cortex in my employer's network, and [the day I became maintainer 3 years ago](b4daa22). It was full of joys and emotions. But there is always an end to a party, and for me it's today. 

Thank you all for the great work and support thus far! 

Signed-off-by: Alvin Lin <alvinlin@amazon.com>
friedrichg pushed a commit that referenced this pull request Jul 30, 2024
I can't believe this day would come, but I am stepping down as Cortex maintainer because I no longer have capacity to give Cortex the love it needs anymore. Also, Cortex is in good hands with existing maintainers from diverse set of companies.

It's been a fun ride. I still remember my [first Cortex PR](#2741) that allows me to build Cortex in my employer's network, and [the day I became maintainer 3 years ago](b4daa22). It was full of joys and emotions. But there is always an end to a party, and for me it's today. 

Thank you all for the great work and support thus far!

Signed-off-by: Alvin Lin <alvinlin@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 participants