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

weird: FROM scratch + label + manifest = Error: choosing image instance: no image found in manifest list for architecture amd64, variant "", OS linux #19860

Closed
edsantiago opened this issue Sep 5, 2023 · 4 comments · Fixed by containers/common#1651
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@edsantiago
Copy link
Member

$ bin/podman rmi -a       <----- tabula rasa
$ bin/podman manifest create m
8c302e57230e3008109ac72140dcd1bafc339510a0dc0cbaa2ccae07e32f49
$ podman images
REPOSITORY   TAG         IMAGE ID      CREATED        SIZE
localhost/m  latest      8c302e57230e  9 seconds ago  110 B

No surprises. Nothing unusual. Now build a scratch image with a label, any label:

$ echo "FROM scratch" | podman build -t i --label a=b -f -
STEP 1/2: FROM scratch
STEP 2/2: LABEL "a"="b"
COMMIT i
--> 00fd88257b95
Successfully tagged localhost/i:latest
00fd88257b95bafc988e62f236130015e8edcb8d57d9895b389dff72d8c03ca6

$ podman images
Error: choosing image instance: no image found in manifest list for architecture amd64, variant "", OS linux

It can be done in either order (build first, then manifest create).

Removing the image succeeds (exit status 0, and image is successfully deleted) but with scary warnings:

$ podman rmi i
WARN[0000] Failed to determine if an image is a parent: choosing image instance: no image found in manifest list for architecture amd64, variant "", OS linux, ignoring the error 
WARN[0000] Failed to determine parent of image: choosing image instance: no image found in manifest list for architecture amd64, variant "", OS linux, ignoring the error 
Untagged: localhost/i:latest
Deleted: 00fd88257b95bafc988e62f236130015e8edcb8d57d9895b389dff72d8c03ca6

The obvious fix is to add build --platform=linux/amd64 -- nope, no difference.

Removing --label fixes everything.

@edsantiago edsantiago added the kind/bug Categorizes issue or PR as related to a bug. label Sep 5, 2023
@edsantiago
Copy link
Member Author

Another way to hose podman images without using labels is to use ARG:

$ podman manifest create m
$ printf "FROM scratch\nARG TARGETARCH\n" | podman build -t i -f -

@edsantiago
Copy link
Member Author

Using buildah build instead of podman build, everything works (no errors). Likewise, adding --layers=false to podman build makes the error go away.

edsantiago added a commit to edsantiago/libpod that referenced this issue Sep 5, 2023
Primarily, build test images FROM scratch, not alpine, to
avoid image pulls and network flakes and potential pull-
the-rug-out errors if the base alpine image changes.

This was much more complicated than it should've been,
because creating unique arch-specific FROM-scratch images
triggered a weird manifest bug, filed as containers#19860.

Also:
- add a teardown() to clean up manifests
- remove test for skopeo (skopeo is required for sys tests)
- remove unnecessary intermediate tmpdir
- deduplicate, by looping over amd+arm
- fix indentation
- and, finally, clean up dangling images (this was the initial
  reason behind my diving in here. Such a simple thing, I thought.)

Signed-off-by: Ed Santiago <santiago@redhat.com>
@rhatdan
Copy link
Member

rhatdan commented Sep 5, 2023

@flouthoc PTAL

@flouthoc flouthoc self-assigned this Sep 6, 2023
flouthoc added a commit to flouthoc/buildah that referenced this issue Sep 7, 2023
A build case where base is `scratch` and only a `label` is added then no
layer is created, its like tagging empty image, in such cases create a
layer.

Closes: containers/podman#19860

Signed-off-by: Aditya R <arajan@redhat.com>
@flouthoc
Copy link
Collaborator

flouthoc commented Sep 7, 2023

PR containers/buildah#5031 should close this

flouthoc added a commit to flouthoc/common that referenced this issue Sep 13, 2023
Layer tree expectes to form a relation between child and parent
instances, however it expects an instance from manifest list which is
empty, following expectation is not possible and will always resuilt in
error.

Closes: containers/podman#19860

[NO NEW TESTS NEEDED]
Image without layer cant be built in libimage, and `podman save`
automatically malforms such image so no such external image can be
loaded.

Signed-off-by: Aditya R <arajan@redhat.com>
flouthoc added a commit to flouthoc/common that referenced this issue Sep 14, 2023
Layer tree expectes to form a relation between child and parent
instances, however it expects an instance from manifest list which is
empty, following expectation is not possible and will always resuilt in
error.

Closes: containers/podman#19860

[NO NEW TESTS NEEDED]
Image without layer cant be built in libimage, and `podman save`
automatically malforms such image so no such external image can be
loaded.

Signed-off-by: Aditya R <arajan@redhat.com>
flouthoc added a commit to flouthoc/common that referenced this issue Sep 14, 2023
Layer tree expectes to form a relation between child and parent
instances, however it expects an instance from manifest list which is
empty, following expectation is not possible and will always resuilt in
error.

Closes: containers/podman#19860

[NO NEW TESTS NEEDED]
Image without layer cant be built in libimage, and `podman save`
automatically malforms such image so no such external image can be
loaded.

Signed-off-by: Aditya R <arajan@redhat.com>
flouthoc added a commit to flouthoc/common that referenced this issue Sep 14, 2023
Layer tree expectes to form a relation between child and parent
instances, however it expects an instance from manifest list which is
empty, following expectation is not possible and will always resuilt in
error.

Closes: containers/podman#19860

[NO NEW TESTS NEEDED]
Image without layer cant be built in libimage, and `podman save`
automatically malforms such image so no such external image can be
loaded.

Signed-off-by: Aditya R <arajan@redhat.com>
flouthoc added a commit to flouthoc/common that referenced this issue Sep 18, 2023
Layer tree expectes to form a relation between child and parent
instances, however it expects an instance from manifest list which is
empty, following expectation is not possible and will always resuilt in
error.

Closes: containers/podman#19860

[NO NEW TESTS NEEDED]
Image without layer cant be built in libimage, and `podman save`
automatically malforms such image so no such external image can be
loaded.

Signed-off-by: Aditya R <arajan@redhat.com>
flouthoc added a commit to flouthoc/common that referenced this issue Sep 18, 2023
Layer tree expectes to form a relation between child and parent
instances, however it expects an instance from manifest list which is
empty, following expectation is not possible and will always resuilt in
error.

Closes: containers/podman#19860

[NO NEW TESTS NEEDED]
Image without layer cant be built in libimage, and `podman save`
automatically malforms such image so no such external image can be
loaded.

Signed-off-by: Aditya R <arajan@redhat.com>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Dec 19, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants