-
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
Slightly different json output causes dockerBuild with podman to fail with "Invalid digest" error for docker://<image> URIs #4134
Comments
Since this report was labeled with |
Thanks again for filing this issue! Taking a deeper look at this issue. I don't have much familiarity with how |
Hi, just encountered this and it is still broken. @mpeddada1 here is the reproducer Given a sample Gradle application generated with plugins {
id 'application'
id 'com.google.cloud.tools.jib' version '3.4.2'
}
repositories {
mavenCentral()
}
dependencies {
testImplementation libs.junit.jupiter
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
implementation libs.guava
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
application {
mainClass = 'org.example.App'
}
tasks.named('test') {
useJUnitPlatform()
}
jib {
from {
image = 'docker://jib-podman-test-base'
}
to {
image = 'jib-podman-test'
}
}
tasks.named('jibDockerBuild').configure {
doFirst {
exec {
workingDir project.projectDir
commandLine 'podman', 'build', '-t', 'jib-podman-test-base', '.'
}
}
} And an
Then run
The problem is that Jib reads the Digest from the wrong place:
This is the
What you need to read is the
This makes jib unusable for this use case on machines with podman only. |
Hm, it seems that docker does not have the Here is the Podman doc for
So you could just prepend Also if here: jib/jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java Lines 82 to 85 in 45610ea
You could somehow detect this and instead of |
If you are OK with it I can send a PR adding |
Here is a fix that works for me locally with the reproduce I posted above: #4298 |
Environment:
Description of the issue:
When using a URI like
docker://ubuntu:latest
for the base image, the build fails with the following exception when using podman (v4.7.1) asjib.dockerClient.executable
:The problem seems to be that in https://github.com/GoogleContainerTools/jib/blob/440bd4897c6c427cc9a491128aa76c72378d605b/jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java#L70C17-L70C17 the value of the
"Id"
property is used as the "digest". The json output for "inspect" differs slightly between podman and docker:podman inspect -f "{{json .}}" --type image ubuntu:latest
:docker inspect -f "{{json .}}" --type image ubuntu:latest
So it seems that in the output of podman we would have to use the value of the "Digest" property instead.
Would you consider adjusting the logic here a bit so that building images from the local cache with podman can also work?
The text was updated successfully, but these errors were encountered: