Skip to content

Error: Unable to pull container image docker://alpine #91

Closed

Description

@allisonkarlitskaya

Pretty straightforward. cfsctl oci pull docker://alpine fails. This is an old issue, but we need to fix it.

Activity

  1. added this to the bootc milestone on Apr 4, 2025
  2. jeckersb commented on Apr 4, 2025

    @jeckersb
    Collaborator

    For completeness-sake, the error I get is:

    $ cargo run -- --repo repo oci pull docker://alpine
        Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.05s
         Running `target/debug/cfsctl --repo repo oci pull 'docker://alpine'`
    Fetching config aded1e1a5b3705116fa0a92ba074a5e0b0031647d9c315983ccba2ee5428ec8b
    Already have layer 08000c18d16dadf9553d747a58cf44023423a9ab010aab96cf263d2216b8b350
    Error: Unable to pull container image docker://alpine
    
    Caused by:
        0: Failed to pull config Descriptor { media_type: ImageConfig, digest: Digest { algorithm: Sha256, value: "sha256:aded1e1a5b3705116fa0a92ba074a5e0b0031647d9c315983ccba2ee5428ec8b", split: 6 }, size: 581, urls: None, annotations: None, platform: None, artifact_type: None, data: None }
        1: Content doesn't have expected SHA256 hash value!
    
  3. cgwalters commented on Apr 4, 2025

    @cgwalters
  4. jeckersb commented on Apr 7, 2025

    @jeckersb
    Collaborator

    @cgwalters helped me run this down today, the problem is basically here in skopeo:

    https://github.com/containers/skopeo/blob/119816b17ce93274910c1e7d5914869582e5545e/cmd/skopeo/proxy.go#L506-L514

    We end up converting the config to an OCIConfig and then re-marshaling it, and the end result is the config comes out with the same content, except the map keys are sorted alphabetically, so the checksum no longer matches the original as listed in the manifest.

    I noticed that skopeo inspect --config --raw does the right thing though, which is here:

    https://github.com/containers/skopeo/blob/119816b17ce93274910c1e7d5914869582e5545e/cmd/skopeo/inspect.go#L131-L139

    Key difference is that just calls ConfigBlob instead of OCIConfig. So I guess since we already have GetConfig and GetFullConfig in the skopeo proxy, we could also add GetConfigBlob that uses ConfigBlob. For now I've patched GetFullConfig to sanity check that it works with great success:

    ⬢ [jeckersb@toolbx composefs-rs]$ which skopeo
    ~/git/skopeo/bin/skopeo
    ⬢ [jeckersb@toolbx composefs-rs]$ cargo run -- oci pull docker://alpine@sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c
       Compiling composefs v0.2.0 (/var/home/jeckersb/git/composefs-rs)
        Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.38s
         Running `target/debug/cfsctl oci pull 'docker://alpine@sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c'`
    Fetching config aded1e1a5b3705116fa0a92ba074a5e0b0031647d9c315983ccba2ee5428ec8b                                                                                                                Fetching layer 08000c18d16dadf9553d747a58cf44023423a9ab010aab96cf263d2216b8b350
    sha256 aded1e1a5b3705116fa0a92ba074a5e0b0031647d9c315983ccba2ee5428ec8b
    verity acaaa9412ea6fd243f44507644dfeea02c85aa9bdf9decd6a5e16beb7e5113d6
    
  5. allisonkarlitskaya commented on Apr 7, 2025

    @allisonkarlitskaya
    CollaboratorAuthor

    How about just GetBlob? Should work for JSON just as well as it does for layers, no?

  6. cgwalters commented on Apr 7, 2025

    @cgwalters
    Collaborator
  7. added a commit that references this issue on Apr 7, 2025
    757e0c2
  8. added a commit that references this issue on Apr 8, 2025
    7fe9137
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions