Commit bb58dbc
committed
fix: Podman image inspect digest for local images
When using `docker://` prefix to use a base image from the local docker
daemon, Jib expects the `{{.Id}}` field from the `docker image inspect`
output to contain a valid image digest prefixed with `sha256:`. However,
with Podman this is not the case and such builds fail with an "Invalid
digest" exception, because Podman returns only the 64-char hash value in
the `{{.Id}}` field without the `sha256:` prefix.
`CliDockerClient` already has the functionality to deal with the hashes
without the `sha256:` prefix. A new method, `fromDigestOrgHash` has
beend added to `DescriptorDigest` which first checks for the digest
prefix and then checks for the hash. This allows full backwards
compatibility and accepts the Podman version of the image Ids.1 parent 45610ea commit bb58dbc
File tree
2 files changed
+10
-1
lines changed- jib-core/src/main/java/com/google/cloud/tools/jib
- api
- docker
2 files changed
+10
-1
lines changedLines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
82 | 91 | | |
83 | 92 | | |
84 | 93 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
0 commit comments