containers / skopeo

Work with remote images registries - retrieving information, images, signing content
Apache License 2.0
7.78k stars 757 forks source link

Skopeo support for buildah images #389

Closed clcollins closed 5 years ago

clcollins commented 6 years ago

I'm unsure if this is a separate issue from https://github.com/projectatomic/skopeo/issues/363...

skopeo copy of a buildah image from containers-storage to a private docker registry fails:

 skopeo copy containers-storage:test:latest docker://private.registry/test:latest
Getting image source signatures
Copying blob sha256:69f7f36900915d6005a0cd35663a72ea818dcd01c3316e6ee38bfe9d54b7a1c1
FATA[0000] Error reading blob sha256:69f7f36900915d6005a0cd35663a72ea818dcd01c3316e6ee38bfe9d54b7a1c1: image not known 

The "missing" layer skopeo is looking for is visible with skopeo inspect containers-storage:test:latest (so that works!):

skopeo inspect containers-storage:test:latest{
    "Digest": "sha256:096b9fc0009db2705d2254941ee427c577b6deec5f7e9dff3c8b32bfe25cb448",
    "RepoTags": [],
    "Created": "2017-06-29T05:48:39Z",
    "DockerVersion": "",
    "Labels": {
        "maintainer": "Chris Collins \u003cchristopher.collins@gmail.com\u003e"
    },
    "Architecture": "amd64",
    "Os": "linux",
    "Layers": [
        "sha256:69f7f36900915d6005a0cd35663a72ea818dcd01c3316e6ee38bfe9d54b7a1c1",
        "sha256:35277e731b5e48d284d127c48f5beb788c6b75359aafff32ed53d69173aa8845"
    ]
}

However, buildah push allows the image to be pushed to the local Docker storage with the docker-daemon transport, and then Skopeo knows how to deal with the image correctly:

$ sudo buildah push test:latest docker-daemon:test:latest
Getting image source signatures
Copying blob sha256:7f11d4f4c9b0a958ca8078c3de168ff11c16d3678a810362655e2fdd99870481
 49.13 MiB / 75.48 MiB [===================================>------------------]
Copying blob sha256:ce2cd8bb05ecae44e1c804fd8c3a184ffad9f77cd5400349185f0b4b7c911a13
 172.19 MiB / 198.80 MiB [=============================================>------]
Copying config sha256:294a6165d13f9332fbaeaf309a7d720ccc2d23f7e0c64755df1a366bbc7cd5a0
 0 B / 2.58 KiB [-------------------------------------------------------------]
Writing manifest to image destination
Storing signatures
 2.58 KiB / 2.58 KiB [========================================================]

$ sudo skopeo copy docker-daemon:test:latest docker://private.registry/test:latest
Getting image source signatures
Copying blob sha256:53e6d99f7596f656354b326bd771a14ed68f0676f05793a9c3d3b799ae447977
 229.41 MB / 229.41 MB [======================================================]
Copying blob sha256:1866690f499d27dd71e340185458240115b9283ce9cc394761b74ca6c076d27f
 322.71 MB / 322.71 MB [======================================================]
Copying config sha256:294a6165d13f9332fbaeaf309a7d720ccc2d23f7e0c64755df1a366bbc7cd5a0
 2.58 KB / 2.58 KB [==========================================================]
Writing manifest to image destination
Storing signatures

This happens regardless of whether the image is "docker formatted" or not during the buildah commit.

Please let me know if this is a buildah issue rather than a skopeo issue, and I'll submit it there.

rhatdan commented 6 years ago

@nalind @runcom @mtrmac PTAL

nalind commented 6 years ago

It's a known buildah issue. It's being worked in https://github.com/containers/image/pull/305 and associated PRs that are linked to from there.

nalind commented 6 years ago

In the meantime, and afterward, buildah push should be able to get the job done. It's not the ideal, but it's something.

jchristi commented 5 years ago

containers/image#305 has been merged. What is the status of this issue?

rhatdan commented 5 years ago

I think we have support for this now. Reopen if I am incorrect.