Skip to content

Conversation

@g-braeunlich
Copy link
Contributor

… to docker config

@welcome
Copy link

welcome bot commented Jan 13, 2021

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

Copy link
Member

@manics manics left a 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?

@meeseeksmachine
Copy link

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

@manics
Copy link
Member

manics commented Jan 27, 2021

@betatim Do you have any concerns with this? Otherwise let's merge it.

Copy link
Member

@minrk minrk left a 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(...)

@g-braeunlich
Copy link
Contributor Author

Ah, I see. Would you recommend to integrate this into the repo2docker script rather than a entrypoint?

@minrk
Copy link
Member

minrk commented Feb 17, 2021

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!

@minrk minrk merged commit dce7984 into jupyterhub:master Feb 17, 2021
@welcome
Copy link

welcome bot commented Feb 17, 2021

Congrats on your first merged pull request in this project! 🎉
congrats
Thank you for contributing, we are very proud of you! ❤️

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