github.com/opencontainers/umoci@v0.4.8-0.20240508124516-656e4836fb0d/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  After getting skopeo, you can download an image as follows. Note that you can
    23  include multiple Docker images inside the same OCI image (under different
    24  "tags").
    25  
    26  ```text
    27  % skopeo copy docker://opensuse/amd64:42.2 oci:opensuse:42.2
    28  Getting image source signatures
    29  Copying blob sha256:f65b94255373e4dc9645fcb551756b87726a1c891fe6c89f6bbbc864ff845c15
    30   46.59 MB / 46.59 MB [=========================================================]
    31  Copying config sha256:5af572844af6ae4122721ba6bfa11b4048dc4535a9f52772e809a68cac4e9244
    32   0 B / 805 B [-----------------------------------------------------------------]
    33  Writing manifest to image destination
    34  Storing signatures
    35  ```
    36  ```text
    37  % skopeo copy docker://opensuse/amd64:42.1 oci:opensuse:old_42.1
    38  Getting image source signatures
    39  Copying blob sha256:d9e29ed5a74f21e153b05ecc646fe1157fcfa991c9661759986191408665521b
    40   36.60 MB / 36.60 MB [=========================================================]
    41  Copying config sha256:1652ed016d569d50729738e2f4ab3564f7375a25150c4a1ac1cc6687e586a5ce
    42   0 B / 805 B [-----------------------------------------------------------------]
    43  Writing manifest to image destination
    44  Storing signatures
    45  ```
    46  
    47  At this point, you have a directory called `opensuse` which is the downloaded
    48  OCI image stored as a directory. This is currently the only type of layout that
    49  umoci can interact with.
    50  
    51  [oci-image]: https://github.com/opencontainers/image-spec
    52  [parcel]: https://github.com/cyphar/parcel
    53  [skopeo]: https://github.com/projectatomic/skopeo