Skip to content

Instantly share code, notes, and snippets.

@scottrigby
Last active December 6, 2022 09:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save scottrigby/de84e62c61d1cd16a7f292871d901325 to your computer and use it in GitHub Desktop.
Save scottrigby/de84e62c61d1cd16a7f292871d901325 to your computer and use it in GitHub Desktop.
Inspect OCI artifact locally (Zot, kind, Helm, and Skopeo)
  1. setup

    $ kind create cluster
  2. install zot with minimal image for security-minded dist-spec-only

    $ helm upgrade zot zot/zot --set image.repository=ghcr.io/project-zot/zot-minimal-linux-amd64
  3. port-forward service for ease

    $ kubectl port-forward svc/zot 5000:5000
  4. Test pushing a bare helm chart to zot

    $ helm create foo && helm package foo
    $ helm push foo-0.1.0.tgz oci://127.0.0.1:5000
  5. inspect OCI package with Skopeo

    $ skopeo inspect --raw --tls-verify=false docker://127.0.0.1:5000/foo:0.1.0 | jq
    {
      "schemaVersion": 2,
      "config": {
        "mediaType": "application/vnd.cncf.helm.config.v1+json",
        "digest": "sha256:af9c03c64b1d3d1c76a09d75faf3fd1c8b9ccc97ce0d31e464bccf68fe236674",
        "size": 137
      },
      "layers": [
        {
          "mediaType": "application/vnd.cncf.helm.chart.content.v1.tar+gzip",
          "digest": "sha256:dce0001b81ca61d8710bce34361bdfc05748459adf008a101126508fb7e05309",
          "size": 3750
        }
      ]
    }
  6. cleanup

    $ kind delete cluster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment