docker-maven-plugin
docker-maven-plugin copied to clipboard
Proxy configuration at runtime is ignored
Description
Related to https://github.com/fabric8io/docker-maven-plugin/issues/1148
The docs mention that these maven properties can be used to configure http proxy at runtime and it will create env but they are not found in the running container.
<docker.runArg.http_proxy>http://proxy.example.com:8080</docker.runArg.http_proxy>
<docker.runArg.https_proxy>https://proxy.example.com:8080</docker.runArg.https_proxy>
<docker.imagePropertyConfiguration>override</docker.imagePropertyConfiguration>
Setting the proxy at buildtime works as expected
<docker.buildArg.http_proxy>http://proxy.example.com:8080</docker.buildArg.http_proxy>
I can add the settings.xml
.
<run>
<env>
<http_proxy>http://proxy.example.com:8080</http_proxy>
<https_proxy>https://proxy.example.com:8080</htts_proxy>
</env>
</run>
Info
- docker-maven-plugin version : 0.40.3
- Maven version (
mvn -v
) : 3.6.1
- Docker version : Docker version 20.10.17, build 100c701
- If it's a bug, how to reproduce :
mvn clean install
to run integration test container which performsprintenv
at build time and runtime. You can see thehttp_proxy
env get set during build-time but not during runtime. Expected to be able to set property insettings.xml
to configure proxy for container runtime. I would happily use the<proxies>
option in settings.xml or~/.docker/config.json
but those are both ignored as well. We shouldn't need to specify the proxy directly in the pom.xml because it should be configured in the environment throughsettings.xml
or~/.docker/config.json
. - Sample project : https://github.com/pelletier2017/proxy-docker-maven-plugin
afair, there is nothing like a docker.runArg
property according to https://dmp.fabric8.io/#property-configuration
I think you should try docker.envRun.http_proxy
in your case, if you want to set the http_proxy
env var when running the container.
If this help, please feel free to close this issue.