Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORAS mediaTypes should default to unknown #115

Closed
SteveLasker opened this issue Aug 22, 2019 · 3 comments
Closed

ORAS mediaTypes should default to unknown #115

SteveLasker opened this issue Aug 22, 2019 · 3 comments

Comments

@SteveLasker
Copy link
Contributor

SteveLasker commented Aug 22, 2019

When pushing artifacts to an OCI compliant registry, a manifest.config.mediaType is required to identify the artifact, and layer.config.mediaTypes are required for each layer.

As we look to improve on the current experiences, the current ORAS client requires either too little, defaulting in the wrong defaults, or too much, creating a less than productive experience, easy to make mistakes.

To provide a progressive disclosure experience, I'm proposing two changes:

  1. Provide for an orasConfig file, enabling the user to provide the repetitive values to the oras client. See Simplifying the ORAS client experience  #114
  2. ORAS provides for default unknown mediaTypes for the artifact and layers.

Current Basic Example

Walking through a simple example, the user specifies the artifact path and the files.

oras login demo42.azurecr.io -u $USR -p $PWD 
oras push demo42.azurecr.io/samples/docs-in-markdown:v1 \
    ./orasTest.txt

This generates a manifest that defaults to application/vnd.oci.image.config.v1+json for the artifact and vnd.oci.image.layer.v1.tar for the layers.

{
  "schemaVersion": 2,
  "config": {
    "mediaType": "application/vnd.oci.image.config.v1+json",
    "digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
    "size": 2
  },
  "layers": [
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar",
      "digest": "sha256:532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25",
      "size": 4,
      "annotations": {
        "org.opencontainers.image.title": "orasTest.txt"
      }
    }
  ]
}

This is incorrect, as application/vnd.oci.image.config.v1+json and vnd.oci.image.layer.v1.tar are reserved for container images that would be instanced with the docker or containerD client. For the initial experience to be correct, the user must specify their type, which they may not be ready to think about.

When no artifact or layer mediaTypes are provided, this proposal says ORAS should default:
manifest.config.mediaType = application/vnd.unknown.config.v1+json
layer.mediaType = application/vnd.unknown.layer.v1.tar

See this OCI Artifacts PR 7 for more info.

@jdolitsky
Copy link
Contributor

fixed by #119

@SteveLasker
Copy link
Contributor Author

Opening back up as we have the Artifact mediaType - manifest.config.mediaType checked in. But, the layer config.mediaType isn't yet set. This may need more discussion in the Artifacts PR

@shizhMSFT
Copy link
Contributor

@SteveLasker please re-open this issue if it is still valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants