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

question: Support OCI artifacts with artifactType #1832

Closed
knqyf263 opened this issue Oct 31, 2023 · 2 comments
Closed

question: Support OCI artifacts with artifactType #1832

knqyf263 opened this issue Oct 31, 2023 · 2 comments
Labels
lifecycle/stale question Further information is requested

Comments

@knqyf263
Copy link
Contributor

knqyf263 commented Oct 31, 2023

I tried to generate a manifest with config.mediaType: "application/vnd.oci.empty.v1+json" and artifactType: "application/vnd.example+type" as described below.
https://github.com/opencontainers/image-spec/blob/93f6e65855a1e046b42afbad0ad129a3d44dc971/manifest.md#guidelines-for-artifact-usage

Especially, I want to generate the second example.

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.oci.image.manifest.v1+json",
  "artifactType": "application/vnd.example+type",
  "config": {
    "mediaType": "application/vnd.oci.empty.v1+json",
    "digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
    "size": 2
  },
  "layers": [
    {
      "mediaType": "application/vnd.example+type",
      "digest": "sha256:e258d248fda94c63753607f7c4494ee0fcbe92f1a76bfdac795c9d84101eb317",
      "size": 1234
    }
  ]
}

I used empty.Image and the mutate package, like mutate.ConfigMediaType.

content := []byte(`hello`)
artifactType := "application/vnd.example+type"
img, err := mutate.AppendLayers(empty.Image, static.NewLayer(content, artifactType))
if err != nil {
	panic(err)
}

img = mutate.ConfigMediaType(img, artifactType)

However, it generates the following manifest.

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  "config": {
    "mediaType": "application/vnd.example+type",
    "size": 233,
    "digest": "sha256:185de42e4ed8eb4fc529c9a3ea02d808c1dfe4466737c0bcf30a5d7ad855088f"
  },
  ...

mutate.ConfigMediaType(img, "application/vnd.oci.empty.v1+json") also doesn't work.

Am I missing something? I didn't find artifactType in the manifest definition. Are you intentionally not supporting OCI artifacts as OCI 1.1 is still in progress?

@knqyf263 knqyf263 added the question Further information is requested label Oct 31, 2023
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Keep fresh with the 'lifecycle/frozen' label.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 1, 2024
@wy65701436
Copy link

hi, I'm experiencing the same problem when building an OCI v1.1 manifest. It seems that there is no way to specify the artifactType. Is this still planned?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants