Skip to content
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

Intermediate images not removed when running podman #1676

Open
attiand opened this issue May 23, 2023 · 1 comment
Open

Intermediate images not removed when running podman #1676

attiand opened this issue May 23, 2023 · 1 comment

Comments

@attiand
Copy link

attiand commented May 23, 2023

Description

Intermediate images not removed when running podman. Docker-maven-plugin issues a warning, the warning looks to be related to #1625

Output from Maven (formatted the output for better readability):

[INFO] DOCKER> [fabric8io-test:0.0.1-SNAPSHOT]: Created docker-build.tar in 23 milliseconds
[INFO] DOCKER> [fabric8io-test:0.0.1-SNAPSHOT]: Built image sha256:7f00c
[WARNING] DOCKER> fabric8io-test:0.0.1-SNAPSHOT: Unable to remove image [sha256:7f00c] :
{"cause":"normalizing name for compat API: sha256:7f00c: invalid format: no 64-byte hexadecimal value",
"message":"normalizing image: normalizing name for compat API: sha256:7f00c: invalid format: no 64-byte hexadecimal value","response":500
} 
(Internal Server Error: 500) (dangling image) [{"cause":"normalizing name for compat API: sha256:7f00c: invalid format: no 64-byte hexadecimal value","message":"normalizing image: normalizing name for compat API: sha256:7f00c: invalid format: no 64-byte hexadecimal value","response":500} (Internal Server Error: 500)]

The image id 7f00c from the warning message is still around:

podman images | grep 7f00c
<none>                                                  <none>                                    7f00c3ef4b09  3 minutes ago   666 MB

Info

  • docker-maven-plugin version : 0.43.0
  • Maven version (mvn -v) :
Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: /home/....
Java version: 17.0.7, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-17-openjdk-17.0.7.0.7-3.el9.x86_64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.14.0-284.11.1.el9_2.x86_64", arch: "amd64", family: "unix"
@attiand
Copy link
Author

attiand commented Jun 13, 2023

The REST request issued from the plugin won't work with the podman API:

curl -X DELETE --unix-socket $XDG_RUNTIME_DIR/podman/podman.sock http://v1.41/images/sha256%3Adb7e6?force=1
{"cause":"normalizing name for compat API: sha256:db7e6: invalid format: no 64-byte hexadecimal value","message":"normalizing image: normalizing name for compat API: sha256:db7e6: invalid format: no 64-byte hexadecimal value","response":500}

This however works:

curl -X DELETE --unix-socket $XDG_RUNTIME_DIR/podman/podman.sock http://v1.41/images/sha256%3Adb7e6c4e79c56d5cef1e0bb5eb76e4ba729afdd37452d09b9fd10632ca109cde?force=1
[{"Deleted":"db7e6c4e79c56d5cef1e0bb5eb76e4ba729afdd37452d09b9fd10632ca109cde"},
...

I found no definition of the format of a image name or id from the Docker REST API: https://docs.docker.com/engine/api/v1.41/#tag/Image/operation/ImageDelete

However the OCI specification suggest 256 bits: https://github.com/opencontainers/image-spec/blob/main/config.md#imageid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant