github.com/dctrud/umoci@v0.4.3-0.20191016193643-05a1d37de015/doc/site/quick-start/getting-an-image.md (about) 1 +++ 2 title = "Getting an Image" 3 weight = 10 4 +++ 5 6 For most users, before you can do anything with umoci, you have to first have 7 an [OCI image][oci-image]. At the time of writing, there is no standard way of 8 getting an OCI image. Distribution is still an open topic in the 9 specification, and there are very few implementations of a distribution 10 extension to the OCI specification. I've [personally worked on one][parcel] but 11 there is still a lot of work to go before you can skip this step and get OCI 12 images without the need to convert from other things. 13 14 In order to get an OCI image, you need to convert it from another container 15 image format. Luckily, as the OCI spec was based on the Docker image format, 16 there is no loss of information when converting between the two formats. 17 [skopeo][skopeo] is an incredibly useful tool that allows you to fetch and 18 convert a Docker image (from a registry, local daemon or even from a file saved 19 with `docker save`) to an OCI image (and vice-versa). Read their documentation 20 for more information about the various other formats they support. 21 22 {{% notice warning %}} 23 At the time of writing there is a <a 24 href="https://github.com/projectatomic/skopeo/pull/420">known issue in 25 skopeo</a> (and the latest release does not contain an existing hotfix), caused 26 by a change in <a 27 href="https://blog.docker.com/2017/09/docker-official-images-now-multi-platform/">the 28 "official" library</a>. Some images (such as the above openSUSE images) are not 29 multi-arch and thus still work properly, but this should be taken into 30 consideration. 31 {{% /notice %}} 32 33 After getting skopeo, you can download an image as follows. Note that you can 34 include multiple Docker images inside the same OCI image (under different 35 "tags"). 36 37 ```text 38 % skopeo copy docker://opensuse/amd64:42.2 oci:opensuse:42.2 39 Getting image source signatures 40 Copying blob sha256:f65b94255373e4dc9645fcb551756b87726a1c891fe6c89f6bbbc864ff845c15 41 46.59 MB / 46.59 MB [=========================================================] 42 Copying config sha256:5af572844af6ae4122721ba6bfa11b4048dc4535a9f52772e809a68cac4e9244 43 0 B / 805 B [-----------------------------------------------------------------] 44 Writing manifest to image destination 45 Storing signatures 46 ``` 47 ```text 48 % skopeo copy docker://opensuse/amd64:42.1 oci:opensuse:old_42.1 49 Getting image source signatures 50 Copying blob sha256:d9e29ed5a74f21e153b05ecc646fe1157fcfa991c9661759986191408665521b 51 36.60 MB / 36.60 MB [=========================================================] 52 Copying config sha256:1652ed016d569d50729738e2f4ab3564f7375a25150c4a1ac1cc6687e586a5ce 53 0 B / 805 B [-----------------------------------------------------------------] 54 Writing manifest to image destination 55 Storing signatures 56 ``` 57 58 At this point, you have a directory called `opensuse` which is the downloaded 59 OCI image stored as a directory. This is currently the only type of layout that 60 umoci can interact with. 61 62 {{% notice warning %}} 63 At the time of writing there is a <a 64 href="https://github.com/projectatomic/skopeo/pull/306">known issue in 65 skopeo</a>, which causes the above examples to not act correctly (only the 66 latest image fetched will be accessible by it's tag name from the OCI image). 67 {{% /notice %}} 68 69 [oci-image]: https://github.com/opencontainers/image-spec 70 [parcel]: https://github.com/cyphar/parcel 71 [skopeo]: https://github.com/projectatomic/skopeo