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

Bug: unable to use podman as the inspect driver #234

Closed
prydom opened this issue Oct 3, 2024 · 9 comments · Fixed by #236
Closed

Bug: unable to use podman as the inspect driver #234

prydom opened this issue Oct 3, 2024 · 9 comments · Fixed by #236
Assignees
Labels
type: bug Something isn't working.

Comments

@prydom
Copy link
Contributor

prydom commented Oct 3, 2024

I get the following error when using podman as the inspect driver (https://github.com/prydom/my-ostree-build/actions/runs/11168292270/job/31046362688#step:4:16533):

[19:38:49  INFO] => Successfully pushed ghcr.io/prydom/fedora-kinoite-laptop:0bd0c1e-42!
[19:38:49 ERROR] => Failed:
  × Failed to inspect image docker://ghcr.io/prydom/fedora-kinoite-laptop:br-
  │ switch-to-podman-42

Running podman image inspect docker://ghcr.io/prydom/fedora-kinoite-laptop:br-switch-to-podman-42 I do get this error, so it's likely we need to remove docker:// from the argument's format string if we want to do a lookup. See https://github.com/blue-build/cli/blob/main/process/drivers/podman_driver.rs#L189.

Error: unsupported transport "docker" for looking up local images
@gmpinder
Copy link
Member

gmpinder commented Oct 3, 2024

So I actually didn't realize I could inspect an image using podman directly. Instead I'm running a skopeo container to get the information (should probably change this to use the podman native way). Right now when I run skopeo to inspect that image I get:

skopeo inspect docker://ghcr.io/prydom/fedora-kinoite-laptop:br-switch-to-podman-42
FATA[0000] Error parsing image name "docker://ghcr.io/prydom/fedora-kinoite-laptop:br-switch-to-podman-42": reading manifest br-switch-to-podman-42 in ghcr.io/prydom/fedora-kinoite-laptop: denied

@prydom
Copy link
Contributor Author

prydom commented Oct 3, 2024

Ah, this is a private registry/image. How does this work for buildx?

It does work when logged in to github:

❯ skopeo inspect docker://ghcr.io/prydom/fedora-kinoite-laptop:br-switch-to-podman-42 | head
{
    "Name": "ghcr.io/prydom/fedora-kinoite-laptop",
    "Digest": "sha256:e1824dfae0ed3f0f307ee89083079eb066ff0908a5dfbd1fbd9054332862965d",
    "RepoTags": [
        "Rawhide",
        "20240421-Rawhide",
        "latest",
        "20240421",
        "5075730-Rawhide",
        "sha256-d641da58d88553db299a1a2690df780d31adbe4090cd4575ad1d2d74d63702dd.sig",

@gmpinder
Copy link
Member

gmpinder commented Oct 3, 2024

This must be because the skopeo container does not have credentials loaded in. This needs to be fixed. I'll work on moving the podman and docker inspect driver to use the proper native inspection. In the meantime, you should be able to just remove the -I arg completely and let it use skopeo to do the inspecting. I'll use this issue to track the change.

@gmpinder gmpinder self-assigned this Oct 3, 2024
@gmpinder gmpinder added the type: bug Something isn't working. label Oct 3, 2024
@prydom
Copy link
Contributor Author

prydom commented Oct 3, 2024

I didn't realize that the native skopeo binary was the default inspection driver, I had assumed it was docker.
I've been rerunning my build with that explicitly set and I likewise expect that to work.

@gmpinder
Copy link
Member

gmpinder commented Oct 3, 2024

So some local testing with podman and docker, it looks like the only way to inspect the images will be to pull them before they can be inspected. I'll still set up the docker/podman inspect driver to use the native methods, however for faster build times the skopeo inspect driver will end up being the recommended way.

@prydom
Copy link
Contributor Author

prydom commented Oct 3, 2024

Setting the inspection driver to skopeo explicitly did indeed resolve the registry login issue:
https://github.com/prydom/my-ostree-build/actions/runs/11168778585/job/31047967916#step:4:16533

@gmpinder
Copy link
Member

gmpinder commented Oct 3, 2024

The skopeo driver will be the default driver if you don't specify it explicitly so long as the binary is present on the machine, so you can remove that if you want. I should create some documentation on the drivers and how they are selected to help clear up any confusion.

@prydom
Copy link
Contributor Author

prydom commented Oct 3, 2024

That would be helpful, I looked at https://github.com/blue-build/cli/blob/566380a82a966b9215d50ec3cf8f860e8e0500b6/process/drivers/types.rs when I was configuring but for whatever reason I only looked at build and run then made an assumption about inspection.

I got there via code search and I didn't read the whole file so it's my bad. I'm happy we caught the discrepancy and agree that it's non-obvious that all three are just using skopeo under the hood.

@gmpinder
Copy link
Member

gmpinder commented Oct 3, 2024

The CLI should be available on your image. You can run bluebuild --help to see all the options available to you if you want to explore more.

@gmpinder gmpinder linked a pull request Oct 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants