cypress-io / cypress-docker-images

Docker images with Cypress dependencies and browsers
https://on.cypress.io/continuous-integration
MIT License
1.02k stars 380 forks source link

docker-image-not-found not compatible with oci mediatype #1141

Closed MikeMcC399 closed 2 months ago

MikeMcC399 commented 3 months ago

Issue

The npm module docker-image-not-found fails with the error message

RestError [InvalidContentError]: unsupported schema version 2

when a Docker Hub image has been published with an OCI image manifest - see Open Container Initiative (OCI).

It is unable to process

   "schemaVersion": 2,
   "mediaType": "application/vnd.oci.image.index.v1+json",

although it can process

   "schemaVersion": 2,
   "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",

docker-image-not-found is used in the circle.yml workflow.

Although strictly speaking this is a failure (return code 1) it is the same code as returned if a docker type image is found. It may be acceptable to ignore this problem for the moment if it does not cause operational problems.

Logs

Background

According to Docker Hub > Registry > Supported media types

You can push images with the following formats:

Compared to Docker buildx v0.9.1 (released Aug 18, 2022) Docker buildx v0.10.0 (released Jan 10, 2023) introduced SLSA Provenance with support for OCI-compliant multi-platform images.

Comparison with other Docker images

Running the following command to inspect other common images, shows that debian (which Cypress Docker images are based on) is using docker mediaType. There has not been a general clear migration to oci mediaType.

docker manifest inspect
Image mediaType
node application/vnd.oci.image.manifest.v1+json
ubuntu application/vnd.oci.image.manifest.v1+json
fedora application/vnd.docker.distribution.manifest.v2+json
debian application/vnd.docker.distribution.manifest.v2+json
cypress/factory application/vnd.docker.distribution.manifest.v2+json

Suggestion

Force circle.yml to generate docker mediaType to retain compatibility with docker-image-not-found. According to https://github.com/docker/buildx/issues/1509#issuecomment-1378538197 this can be achieved through:

Set --provenance=false

MikeMcC399 commented 3 months ago