docker-maven-plugin icon indicating copy to clipboard operation
docker-maven-plugin copied to clipboard

Proxy configuration at runtime is ignored

Open pelletier2017 opened this issue 2 years ago • 2 comments

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 directly in the settings.xml as a workaround, but this is insufficient because each project should not need to specify the proxy. It should be in environment configuration in 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 performs printenv at build time and runtime. You can see the http_proxy env get set during build-time but not during runtime. Expected to be able to set property in settings.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 through settings.xml or ~/.docker/config.json.
  • Sample project : https://github.com/pelletier2017/proxy-docker-maven-plugin

pelletier2017 avatar Dec 24 '22 21:12 pelletier2017

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.

rhuss avatar Feb 14 '23 11:02 rhuss

If this help, please feel free to close this issue.

rhuss avatar Feb 14 '23 11:02 rhuss