skip to Main Content

How do you convert a Docker Image created with e.g. Docker build . to the OCI Format or other formats?

2

Answers


  1. Chosen as BEST ANSWER

    I figured it out. It is quite simple. You would simply create a container for the image. Next you would use the docker export command. More information can be read from docker export --help.


  2. You can use skopeo to change the image format.

    skopeo copy -f <FORMAT> docker://<SOURCE_REGISTRY>/<IMAGE_NAME>:<TAG> docker://<SOURCE_REGISTRY>/<NEW_IMAGE_NAME>:<NEW_TAG>
    

    This will download the image and upload the image in a possibly new format.

    FORMAT can be oci, v2s1, or v2s2

    Example:

    skopeo copy -f oci docker://registry.company.com/myimage:mytag docker://registry.company.com/myimage:mytag-oci
    

    For this the source image needs to be uploaded to a registry.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search