-
Notifications
You must be signed in to change notification settings - Fork 383
Add entrypoint script which automatically propagates *_PROXY env vars… #1003
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
Conversation
… to docker config
|
Thanks for submitting your first pull request! You are awesome! 🤗 |
manics
left a comment
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.
This looks good to me- I tested it in a VM.
One thing I noticed is that this configures the proxy for Dockerfile RUN commands during docker build, but not for pulling the FROM image- I think this can only be changed by configuring the parent docker daemon outside the container which makes sense when you think about it, but it might make the corresponding BinderHub configuration more complicated.
@betatim You're making a release soon, are you happy for this to be merged or do you want to wait until after the release?
|
This pull request has been mentioned on Jupyter Community Forum. There might be relevant details there: https://discourse.jupyter.org/t/binder-behind-outbound-proxy/7428/5 |
|
@betatim Do you have any concerns with this? Otherwise let's merge it. |
minrk
left a comment
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.
Happy to have this change!
I'll just comment for anyone who has concerns about maintaining the generation of valid JSON config produced by echoing lines, repo2docker is in Python so we could write this config file with Python and make it a little simpler, e.g.:
config = {"proxies": {"default": {}}
for env, key in {"HTTP_PROXY": "httpProxy"...}.items():
value = os.environ.get(env)
if value:
config["proxies"]["default"][key] = value
if config["proxies"]["default"]:
with open(config_path, "w") as f:
json.dump(config, f)
os.execv(...)|
Ah, I see. Would you recommend to integrate this into the repo2docker script rather than a entrypoint? |
No, I meant that the entrypoint script itself could be in Python if we have issues with this. It's fine as-is, though! |


… to docker config