How to create an OCI Windows container image

242 Views Asked by At

I have to build my container images in OCI (Open Container Initiative) format. I have Linux and Windows Containers. If I do the following with podman the manifest is "application/vnd.oci.image.manifest.v1+json":

podman build -t webapi:latest -f ./src/webapi/Dockerfile ./src/webapi    
podman tag webapi:latest registry.gitlab.com/acme/sub/webapi:latest
podman push registry.gitlab.com/acme/sub/webapi:latest
podman pull registry.gitlab.com/acme/sub/webapi:latest
podman image inspect registry.gitlab.com/acme/sub/webapi:latest|grep Manifest
# => application/vnd.oci.image.manifest.v1+json

When I do the build with docker the manifest is "application/vnd.docker.distribution.manifest.v2+json":

docker build -t webapi:latest -f ./src/webapi/Dockerfile ./src/webapi    
docker tag webapi:latest registry.gitlab.com/acme/sub/webapi:latest
docker push registry.gitlab.com/acme/sub/webapi:latest
podman pull registry.gitlab.com/acme/sub/webapi:latest
podman image inspect registry.gitlab.com/acme/sub/webapi:latest|grep Manifest
# => application/vnd.docker.distribution.manifest.v2+json

For my windows containers I can not use podman.

The main question is: How can I create an OCI windows container and push it in a registry?

Other questions are:

  1. How can I check if an image is an OCI image?
  2. Can I use "docker buildx" to create an OCI image? And how can I push it?
  3. Can I build an Windows image with different tools?
  4. Does it make sense to create an OCI Windows image?
0

There are 0 best solutions below