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

Proxy settings are ignored #1148

Closed
jakub-bochenski opened this issue Jan 8, 2019 · 6 comments
Closed

Proxy settings are ignored #1148

jakub-bochenski opened this issue Jan 8, 2019 · 6 comments
Assignees

Comments

@jakub-bochenski
Copy link
Contributor

jakub-bochenski commented Jan 8, 2019

Description

Since Docker 17.07 you can configure the client to use a proxy.
When running build via d-m-p it doesn't work.

See linked project on how to reproduce.

Info

@jakub-bochenski
Copy link
Contributor Author

Workaround: pass the settings manually using build args, e.g. -Ddocker.buildArg.http_proxy=http://proxy:8001

@daniele-bottelli
Copy link

same problem proxy set in ~/.docker/config.json is ignored

plugin version 0.26.0
docker 18.06.1-ce

thanks @jakub-bochenski for the workaround :)

@kortemik
Copy link

It would be really useful to be able to configure pushProxy and pullProxy, as either one of them can be behind a proxy.

@rhuss
Copy link
Collaborator

rhuss commented Apr 5, 2019

@jakub-bochenski So your suggestion is that d-m-p should evaluated a ~/.docker/config.json for proxy setting and then set those environment variables (HTTP_PROXY) automatically for build and run ? When you would set them manually (as you did with build.args) then it should would already work, right ? Also I think, we could examine the proxy settings in ~/.maven/settings.xml for Maven to implicitely evaluate the proxy settings. Please note though, that the proxy is used on the Docker dameon's host and not on the host where maven is running on (but they could be the same).

@kortemik For pull and push the situation is different, as this is performed by the Docker dameon itself. I don't see any possibility that a client can influence this. The only way I know to use proxies for pull and push is to configure the Docker daemon accordingly. But I could have missed something, so when you know how a Docker client can influence this, please let me know.

@jakub-bochenski
Copy link
Contributor Author

jakub-bochenski commented Apr 5, 2019

your suggestion is that d-m-p should evaluated a ~/.docker/config.json for proxy setting

d-m-p is already processing some of the config values there. Principle of least astonishment would suggest processing all of it.

I value the ability to switch between bare docker CLI and d-m-p seamlessly. It makes (would make) hacking/testing/migration etc. so much easier.

Finally just as I woulnd't want to have to specify the proxy settings explicitly for Docker CLI, I don't want to hve to expose them for Maven. This is not only about readability but also about portability.
Right now I have to make special arrangements to inject an env variable to use when calling Maven. For all other cases I just have a docker config provided.

Also I think, we could examine the proxy settings in ~/.maven/settings.xml for Maven to implicitely evaluate the proxy settings.

That certainly wouldn't hurt, though I would suggest giving the docker config priority in case of settings being present in both.

@rhuss
Copy link
Collaborator

rhuss commented Apr 5, 2019

I totally agree that a proxy setting should not be part of the build (i.e. not entered in the pom.xml) and ideally not how the build is called. So it should be specific to the environment where the build is called.

So I agree and I think respecting the proxy settings in ~/.docker/config.json is a good thing.

@jakub-bochenski @rohanKanojia fancy for jumping on a PR for this ? (sorry, no space left on my plate right now ;-(

@rohanKanojia rohanKanojia self-assigned this Apr 5, 2019
rohanKanojia added a commit to rohanKanojia/docker-maven-plugin that referenced this issue Apr 5, 2019
Make BuildService read local ~/.docker/config.json directory and fetch
proxy settings.
rohanKanojia added a commit to rohanKanojia/docker-maven-plugin that referenced this issue Apr 5, 2019
Make BuildService read local ~/.docker/config.json directory and fetch
proxy settings.
rohanKanojia added a commit to rohanKanojia/docker-maven-plugin that referenced this issue Apr 5, 2019
Make BuildService read local ~/.docker/config.json directory and fetch
proxy settings.
rohanKanojia added a commit to rohanKanojia/docker-maven-plugin that referenced this issue Apr 5, 2019
Make BuildService read local ~/.docker/config.json directory and fetch
proxy settings.
rohanKanojia added a commit to rohanKanojia/docker-maven-plugin that referenced this issue Apr 6, 2019
Make BuildService read local ~/.docker/config.json directory and fetch
proxy settings.
rhuss pushed a commit that referenced this issue Apr 6, 2019
Make BuildService read local ~/.docker/config.json directory and fetch
proxy settings.
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

No branches or pull requests

5 participants