Getting manifest for base image uses Proxy even if it is set in nonProxyHosts
See original GitHub issueEnvironment:
- Jib version: 2.7.1
- Build tool: Maven
- OS: Ubuntu (Official 3.6.3 Docker Image with openjdk 11) running on Jenkins as agent
Description of the issue:
Timeout while Getting manifest for base image. It still uses proxy, but it was set as nonProxyHost in settings.xml and jvm.config .
Expected behavior:
Should honor proxy settings.
Steps to reproduce:
- Setup System Proxy
- Add settings.xml and jvm.config with nonProxyHost
- set From Image to a registry in nonProxyHost
jib-maven-plugin
Configuration:
<configuration>
<skip>${docker.image.skip}</skip>
<from>
<image>internal.reg.com/openjdk:11-jre-slim-latest</image>
</from>
<to>
<image>${docker.registry}/${docker.image.prefix}/${docker.image.name}</image>
</to>
<container>
<creationTime>USE_CURRENT_TIMESTAMP</creationTime>
<ports>
<port>${docker.image.exposedPort}</port>
</ports>
</container>
<pluginExtensions>
<pluginExtension>
<implementation>com.google.cloud.tools.jib.maven.extension.springboot.JibSpringBootExtension</implementation>
</pluginExtension>
</pluginExtensions>
</configuration>
Log output:
[WARNING] Base image ‘internal.reg.com/openjdk:11-jre-slim-latest’ does not use a specific image digest - build may not be reproducible [INFO] Getting manifest for base image internal.reg.com/openjdk:11-jre-slim-latest… [INFO] Building dependencies layer… [INFO] Building resources layer… [INFO] Building classes layer… [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for service 0.0.1-SNAPSHOT: [INFO] [INFO] service … SUCCESS [ 1.847 s] [INFO] service_api … SUCCESS [ 0.307 s] [INFO] service_app … FAILURE [01:00 min] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:02 min [INFO] Finished at: 2021-02-18T12:52:54Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:2.7.1:dockerBuild (default-cli) on project service_app: 503 Service Unavailable [ERROR] GET https://internal.reg.com/v2/openjdk/manifests/11-jre-slim-latest
Additional Information: File can be downloaded without proxy. Proxy (Squid) provides 503, because he cannot resolve hostname.
<proxy>
<id>http-proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>security-proxy.reg.net</host>
<port>3128</port>
<nonProxyHosts>localhost|127.0.0.1|*.reg.com|internal.reg.com</nonProxyHosts>
</proxy>
<proxy>
<id>https-proxy</id>
<active>true</active>
<protocol>https</protocol>
<host>security-proxy.reg.net</host>
<port>3128</port>
<nonProxyHosts>localhost|127.0.0.1|*.reg.com|internal.reg.com</nonProxyHosts>
</proxy>
-Dhttp.nonProxyHosts="localhost|127.0.0.1|*.reg.com|internal.reg.com"
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
@chanseokoh: Yes the issue is resolved. Had to set the setting additionally in the MAVEN_OPTS (could have been set in as cli param also), because the system settings had another syntax in the http.nonProxyHosts . This is because of another tool that needs commas instead of | to separate hosts . So setting all the proxy settings explicitly worked.
Thanks for the update. So, is the issue resolved? Have you figured out why it’s not working in your environment?