Skip to content

Support Docker OCI images

Stan Hu requested to merge sh-support-docker-oci-images into master

Docker Distribution v2.7.0 shipped with OCI support, but our container registry client was not updated to handle the manifest format in the HTTP Accept header. As a result, API calls to retrieve a manifest would return with an error, "OCI manifest found, but accept header does not support OCI manifests". This would result in blank fields in the container registry page and prevent tags from being deleted.

To fix this, we just need to add application/vnd.oci.image.manifest.v1+json to the Accept header and configure Faraday to parse the response as JSON. The response structure is the same as the standard Docker Distribution V2 manifest.

Testing notes

To test this, I had to:

  1. Install buildah: https://github.com/containers/buildah/blob/master/install.md
  2. Install runc (apt-get install runc)
  3. Build the localhost/fedora-httpd image with buildah: https://github.com/containers/buildah/blob/master/docs/tutorials/01-intro.md#using-dockerfiles-with-buildah
  4. buildah push localhost/fedora-httpd myexample.com:5000/gitlab/testme:ocitest
Edited by Stan Hu

Merge request reports