Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jackhodgkiss
Copy link
Contributor

No description provided.

@jackhodgkiss jackhodgkiss requested a review from a team as a code owner December 29, 2023 12:31
Copy link
Contributor

@MaxBed4d MaxBed4d left a 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

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.

Comment on lines +10 to +11
ARG http_proxy
ARG https_proxy

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.

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?

Copy link
Contributor Author

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.

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.

Choose a reason for hiding this comment

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

CC @jovial

Copy link
Collaborator

@jovial jovial Jan 11, 2024

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 🤔

Copy link
Contributor Author

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.

Copy link
Collaborator

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?

Copy link
Collaborator

@jovial jovial Jan 11, 2024

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.

Copy link
Collaborator

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

jackhodgkiss added a commit to stackhpc/ansible-collection-kayobe-workflows that referenced this pull request Jan 3, 2024
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
jackhodgkiss added a commit to stackhpc/ansible-collection-kayobe-workflows that referenced this pull request Jan 3, 2024
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
jackhodgkiss added a commit to stackhpc/ansible-collection-kayobe-workflows that referenced this pull request Jan 3, 2024
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
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.

4 participants