question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting manifest for base image uses Proxy even if it is set in nonProxyHosts

See original GitHub issue

Environment:

  • 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:

  1. Setup System Proxy
  2. Add settings.xml and jvm.config with nonProxyHost
  3. 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:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sforner405commented, Feb 20, 2021

@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.

0reactions
chanseokohcommented, Feb 19, 2021

Thanks for the update. So, is the issue resolved? Have you figured out why it’s not working in your environment?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure Docker to use a proxy server - Docker Documentation
In Docker 17.06 and earlier versions, you must set the appropriate environment variables within the container. You can do this when you build...
Read more >
http.nonProxyHost is ignored if proxy authentication is ... - Jira
Use the following configuration in catalina.properties, setenv.sh or the Windows Service. #web proxy settings http.proxyHost=localhost http.proxyPort=8888 http.
Read more >
Configuring Proxy Settings for All Apps | VMware Tanzu Docs
To globally configure proxy settings for Ops Manager apps, you must set three environment variables for both the staging environment ...
Read more >
Gradle proxy configuration - Stack Overflow
I tried this and didn't work for me. I had to set the options ( -Dhttp.proxyHost and the likes) as JAVA_OPTS environment variable...
Read more >
Using Nexus OSS as a proxy/cache for Docker images
Here, I'll use Sonatype Nexus to set this all up, mainly as this functionality is available in the OSS version (where Artifactory only ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found