-
Notifications
You must be signed in to change notification settings - Fork 2.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
Wrong image tag is used when creating a container from an image with multiple tags #8547
Comments
There seems to be a deeper problem. I was able to reproduce this error with the CLI also. Assuming we have these images:
Test with
|
Running the examples with Podman 3.0-dev (e2f9120) with the CLI seems to work correctly, but fails when run through the API. 😕 via CLI
via API
Note the |
My current summary:
|
use the master branch:
|
Did you try creating the container with the other tag?
|
Follow your steps can indeed reproduce, use the
|
/assign @zhangguanzhang |
Awesome, thank you for the fix. 😄 |
/kind bug
Description
Trying to find regressions from Podman 2.1.1 by exercising the APIv2 trough docker-py's test suite (see #5386) I came across a regressions in the
ListContainersTest.test_list_containers
test.When listing containers (i.e.
GET /v1.40/containers/json?all=1
) the"Image"
field has values like `"docker.io/library/sha256:be4e4bea2c2e15b403bb321562e78ea84b501fb41497472e91ecb41504e8a27c" which throws off any code that expects it to be the same as what the container was created with (here: "alpine:3.10").What "breaks" the listing containers test is another test called
ImageCollectionTest.test_save_and_load
which saves an image (also"alpine:3.10"
🤨 ) into a file and loads it into the local image repository again.NOTE: when loading the image Podman adds an extra tag in the form of
"docker.io/library/sha256:be4e4bea2c2e15b403bb321562e78ea84b501fb41497472e91ecb41504e8a27c"
to the image where the SHA corresponds to the actual image id. Now the image has two tags! It seems Docker doesn't add the extra tag.When we then run the original test again (i.e.
ListContainersTest.test_list_containers
) it's supposed to create a container from the "alpine:3.10" image. Here's where the weird thing happens: the container's the image is saved (into the BoltDB) as"docker.io/library/sha256:be4e4bea2c2e15b403bb321562e78ea84b501fb41497472e91ecb41504e8a27c"
(same image, but wrong tag).Steps to reproduce the issue:
The following (trans-)script shows what happens. It can be run in the Python interpreter (assuming docker-py is installed).
Describe the results you received:
This is what happens with Podman 3.0-dev:
Describe the results you expected:
This is what happens with Podman 2.1.1:
Additional information you deem important (e.g. issue happens only occasionally):
This worked on Podman 2.1.1 and fails on 3.0-dev (currently: b2cd6e0).
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):The text was updated successfully, but these errors were encountered: