How do you convert a Docker Image created with e.g. Docker build . to the OCI Format or other formats?
Docker build .
2
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.
docker export command
docker export --help
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
FORMAT
oci
v2s1
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.
Click here to cancel reply.
2
Answers
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 fromdocker export --help
.You can use skopeo to change the image format.
This will download the image and upload the image in a possibly new format.
FORMAT
can beoci
,v2s1
, orv2s2
Example:
For this the source image needs to be uploaded to a registry.