-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
buildTar fails with latest Google distroless Java 17 images #3958
Comments
also confirmed with: jib: 2.8.0 and gcr.io/distroless/java11-debian11:debug |
Thank you for reporting this! I think the observed limitation is coming from Jib’s base image caching mechanism currently only expecting Docker and not OCI format for manifest lists. jib/jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/PullBaseImageStep.java Line 471 in e50b825
To work around this issue in the meanwhile, you may find this discussion in GoogleContainerTools/distroless#1259 helpful. For your use case, would it be possible to switch to a platform-specific tag for the image (which does not use manifest list), or an older version that still uses the docker format? |
Yeah, #3715 add the capability to pull an OCI index, but it missed loading cached images. So, Jib works the first time it pulls an OCI image, but subsequent runs fail because I guess it won't be that difficult to change |
I get similar behavior but with a different error message, with jib:build
|
@rvaidya @cqwense to clarify, you're using an old version of Jib. The OCI image index support was added in Jib 3.3.0. (But of course, you'll hit this issue even when using 3.3.0+.) |
Environment:
Description of the issue:
We updated our base images (hash is the difference) from
gcr.io/distroless/java17-debian11:nonroot@sha256:3481476327255f2e553415945d9c774dc5936273bf94cfc01509f044da7b3ed5
to
gcr.io/distroless/java17-debian11:nonroot@sha256:5154596f58d81687d66c8302face284198caf65033cde6bf6667c488b21745e6
The maven build fails with
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.3.1:buildTar (default-cli) on project spring-boot-k8s-example: class com.google.cloud.tools.jib.image.json.OciIndexTemplate cannot be cast to class com.google.cloud.tools.jib.image.json.V22ManifestListTemplate (com.google.cloud.tools.jib.image.json.OciIndexTemplate and com.google.cloud.tools.jib.image.json.V22ManifestListTemplate are in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @2262d6d5) -> [Help 1]
Expected behavior:
Build passes as before and our application images are build successfully.
Steps to reproduce:
./mvnw -DskipTestspackage jib:buildTar
jib-maven-plugin
Configuration:Log output:
Additional Information:
The behavior does not occur with the previously mentioned image (
gcr.io/distroless/java17-debian11:nonroot@sha256:3481476327255f2e553415945d9c774dc5936273bf94cfc01509f044da7b3ed5
) .There was a change to the image build that moved from docker manifest format to OCI format
See this commit:
GoogleContainerTools/distroless@fb94acc
The text was updated successfully, but these errors were encountered: