-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add support for proxy settings during docker build #45
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed in Google meet.
ARG http_proxy | ||
ARG https_proxy | ||
ENV http_proxy $http_proxy | ||
ENV https_proxy $https_proxy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's quite common to also need no_proxy, but I note that Will had problems will commas.
ARG http_proxy | ||
ARG https_proxy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already pass these args in when building the image in SKC CI. Presumably they were unused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also see that http(s)_proxy are referenced on L69, perhaps coming from Docker config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that is the case then we would need to move them before download packages as SMSLab kayobe-automation cannot build unless these proxy settings are present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's wait for Will to get the history on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC @jovial
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I did once bake in the the proxy environment variables as env vars, but I recall I had issues when using the same image in another environment (which used another proxy). Passing these variables in at runtime seemed like the better option. Is this the only way to set a proxy at build time? I thought there were some command line parameters to docker build 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will investigate further. Good point about sharing the image between environment and still carrying the proxy settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we could make them not persistent after build that would be ideal. Can we get away with the build arg only and possibly pass them in like this:
RUN http_proxy=$http_proxy https_proxy=$http_proxy ./script
or possibly you can clear the env var?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed the comment in https://github.com/stackhpc/kayobe-automation/pull/45/files#r1440221535, so that code is still in there. I guess this isn't so bad then. My feeling is that approach of baking it in was a bit of a mistake though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the magic that means that you don't need to explicitly define the build arg: https://docs.docker.com/engine/reference/builder/#predefined-args
In some deployments it may be necessary to use `HTTP` and `HTTPS` proxies in order to allow the kayobe image to be built. Requires: stackhpc/kayobe-automation#45
In some deployments it may be necessary to use `HTTP` and `HTTPS` proxies in order to allow the kayobe image to be built. Requires: stackhpc/kayobe-automation#45
In some deployments it may be necessary to use `HTTP` and `HTTPS` proxies in order to allow the kayobe image to be built. Requires: stackhpc/kayobe-automation#45
No description provided.