containers / skopeo

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

Possible to copy from local docker to OCI image? #199

Closed amitsaha closed 7 years ago

amitsaha commented 7 years ago

Hello, I know I can do this:

$ skopeo copy docker://busybox:latest oci:existingemptydirectory

However, can I specify the source as a docker image which is only present locally? Trying it gives me:

$ sudo docker images
REPOSITORY                      TAG                 IMAGE ID            CREATED             SIZE
amitsaha/rootfs-1               latest              bbb478419aa9        7 minutes ago       115.9 MB

$ sudo skopeo copy docker://amitsaha/rootfs-1:latest oci:existingemptydirectory1
FATA[0005] Error reading manifest: error fetching manifest: status code: 401, body: {"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":[{"Type":"repository","Name":"amitsaha/rootfs-1","Action":"pull"}]}]}

If this is not yet available, is there any alternative to directly converting a docker image which is not in any supported registry to an OCI bundle? Thanks for any hints!

mtrmac commented 7 years ago

docker: refers to images published on docker registry servers; in this context amitsaha/rootfs-1:latest is read as a shorthand for docker.io/amitsaha/rootfs-1:latest.

Accessing images managed locally by the Docker daemon is being worked on in containers/image, and accessible through https://github.com/mtrmac/skopeo/tree/docker-daemon , using a docker-daemon: transport (e.g. docker-daemon:amitsaha/rootfs-1:latest. This is known to be incomplete, nevertheless testing would be appreciated. A trivial smoke test seems to work.

amitsaha commented 7 years ago

@mtrmac awesome, going to test this now/soon ish and will report back! Thanks.

amitsaha commented 7 years ago

@mtrmac tested it just now, seems to be working great!

mtrmac commented 7 years ago

Thanks for testing, docker-daemon: support is now merged in master.

abdennour commented 3 years ago

docker-daemon:<image> not docker-deamon://<image> i hope this tip is helpful

mirekphd commented 11 months ago

docker-daemon:<image> not docker-deamon://<image> i hope this tip is helpful

I'd consider making both variants work or documenting this idiosyncrasy / exception.

mtrmac commented 11 months ago

docker:// is the exception, really.