InsecureRegistryException thrown for all registries including the default registry and distroless registry
See original GitHub issueDescription of the issue:
InsecureRegistryException
thrown for all registries (including default where distroless image is hosted)
Expected behavior:
mvn jib:build
completes without failing due to secure registries being insecure
Steps to reproduce:
mvn jib:build
Environment: MacOS 10.14, Maven 3.5.4, Java 9.0.4
jib-maven-plugin
Configuration:
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>0.9.13</version>
<configuration>
<from>
<image>openjdk:10</image>
</from>
<to>
<image>${env.REMOTE_IMAGE_URL}</image>
<credHelper>ecr-login</credHelper>
<tags>
<tag>JIB-TEST-IMAGE</tag>
</tags>
</to>
</configuration>
</plugin>
Log output:
Caused by: com.google.cloud.tools.jib.registry.InsecureRegistryException: Failed to verify the server at https://registry.hub.docker.com/v2/library/openjdk/manifests/10 because only secure connections are allowed.
at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.handleUnverifiableServerException (RegistryEndpointCaller.java:169)
at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.callWithAllowInsecureRegistryHandling (RegistryEndpointCaller.java:154)
at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call (RegistryEndpointCaller.java:141)
at com.google.cloud.tools.jib.registry.RegistryClient.callRegistryEndpoint (RegistryClient.java:355)
at com.google.cloud.tools.jib.registry.RegistryClient.pullManifest (RegistryClient.java:225)
at com.google.cloud.tools.jib.registry.RegistryClient.pullManifest (RegistryClient.java:233)
at com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.pullBaseImage (PullBaseImageStep.java:194)
at com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.call (PullBaseImageStep.java:116)
at com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.call (PullBaseImageStep.java:57)
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly (TrustedListenableFutureTask.java:127)
at com.google.common.util.concurrent.InterruptibleTask.run (InterruptibleTask.java:57)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run (TrustedListenableFutureTask.java:80)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
at java.lang.Thread.run (Thread.java:844)
Additional Information:
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
google/jib - Gitter
always throw java.net.UnknownHostException: registry-1.docker.io: Name or service not known when I'm offline. Any workaround? Thorbjørn Ravn Andersen.
Read more >Unauthorized error when build docker image with jib, using a ...
Jib does cache base images, so using an image in a registry doesn't mean Jib ... The default directory is src/main/jib , so...
Read more >Index (jib-core 0.11.0 API) - Javadoc.io
Constructs a TarImage with the specified path. authenticatePull(Credential) - Method in class com.google.cloud.tools.jib.registry.RegistryAuthenticator.
Read more >Why distroless containers aren't the security solution you think ...
Fallacy #1: Size is The Most Important to Attack Surface · Not all files in a container image contribute to attack surface equally...
Read more >Building Java containers with Jib - Google Cloud
Authenticate to Container Registry, using the Google Cloud CLI as a Docker credential ... To configure gcloud with defaults for your Cloud Run...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is due to some popular root CA certs missing or incomplete in some OpenJDK versions. Looks like the very first OpenJDK 9 had an empty cacerts, and then, Oracle open-sourced a set of root certificates issued by the CAs who signed some Oracle agreement to include the certificates in later JDK builds. However, I remember some important CA certs were still missing in OpenJDK 11 Early Access, but maybe this last bit is resolved this for OpenJDK 11 GA, so hopefully everything works out of the box starting from OpenJDK 11.
Hi @hedvigoscar,
We are aware that some JDKs cannot verify certain servers. We’ve seen it with certain JDK 9 and JDK 10 (like in this case). You said your environment is Java 9.0.4. I just downloaded OpenJDK 9.0.4 from jdk.java.net and noticed it cannot verify Docker Hub. (BTW, OpenJDK 9.0.4 does not include security fixes and no longer recommended for use in production.)
Then you get the following error: