helm: OCI: Not able to push chart to

Output of helm version: version.BuildInfo{Version:“v3.0.0-alpha.1”, GitCommit:“b9a54967f838723fe241172a6b94d18caf8bcdca”, GitTreeState:“clean”}

~ $ helm create dummy-chart
Creating dummy-chart

~ $ helm chart save dummy-chart registry.hub.docker.com/karuppiah7890/dummy-chart
Using default tag: latest
Name: dummy-chart
Version: 0.1.0
Meta: sha256:42603b382336019d658ec8c0c71c57be421dc49a471ce6c6b776d7834e54cbec
Content: sha256:2b41efbc14985cd820ef48a2e898ac839559f6b77fd2a49af29dd7d6c4c3004c
latest: saved

~ $ helm chart push registry.hub.docker.com/karuppiah7890/dummy-chart
Using default tag: latest
The push refers to repository [registry.hub.docker.com/karuppiah7890/dummy-chart]
Name: dummy-chart
Version: 0.1.0
Meta: sha256:42603b382336019d658ec8c0c71c57be421dc49a471ce6c6b776d7834e54cbec
Content: sha256:2b41efbc14985cd820ef48a2e898ac839559f6b77fd2a49af29dd7d6c4c3004c
Error: failed commit on ref "manifest-sha256:febab107d93e89faa3926f875441334358562220d47d48230346e9b51fd46500": un
expected status: 400 Bad Request

When I tried to debug, the response from Docker Hub said -

{"errors":[{"code":"MANIFEST_INVALID","message":"manifest invalid","detail":{}}]}

and digging more, I saw that the manifest json looks like this -

{
    "schemaVersion": 2,
    "config": {
        "mediaType": "application/vnd.oci.image.config.v1+json",
        "digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
        "size": 2
    },
    "layers": [
        {
            "mediaType": "application/vnd.cncf.helm.chart.meta.v1+json",
            "digest": "sha256:42603b382336019d658ec8c0c71c57be421dc49a471ce6c6b776d7834e54cbec",
            "size": 106,
            "annotations": {
                "org.opencontainers.image.title": "chart-meta.json"
            }
        },
        {
            "mediaType": "application/vnd.cncf.helm.chart.content.v1+tar",
            "digest": "sha256:2b41efbc14985cd820ef48a2e898ac839559f6b77fd2a49af29dd7d6c4c3004c",
            "size": 2268,
            "annotations": {
                "org.opencontainers.image.title": "chart-content.tgz",
                "sh.helm.chart.name": "dummy-chart",
                "sh.helm.chart.version": "0.1.0"
            }
        }
    ]
}

and layers struct looks like this -

[{MediaType:application/vnd.cncf.helm.chart.meta.v1+json Digest:sha256:42603b382336019d658ec8c0c71c57be421dc49a471ce6c6b776d7834e54cbec Size:106 URLs:[] Annotations:map[org.opencontainers.image.title:chart-meta.json] Platform:<nil>} {MediaType:application/vnd.cncf.helm.chart.content.v1+tar Digest:sha256:2b41efbc14985cd820ef48a2e898ac839559f6b77fd2a49af29dd7d6c4c3004c Size:2268 URLs:[] Annotations:map[org.opencontainers.image.title:chart-content.tgz sh.helm.chart.name:dummy-chart sh.helm.chart.version:0.1.0] Platform:<nil>}]

And I tried the same by tagging the chart too, for example registry.hub.docker.com/karuppiah7890/dummy-chart:v1.0.0 and I still couldn’t push the chart.

Docker Hub API is OCI Spec compliant right? Am I missing something here?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 4
  • Comments: 24 (10 by maintainers)

Most upvoted comments

This works for me on GCR (Google Cloud Platform, Google Container Registry).

$ helm version
version.BuildInfo{Version:"v3.0.0-alpha.1", GitCommit:"b9a54967f838723fe241172a6b94d18caf8bcdca", GitTreeState:"clean"}

Here my steps:

helm package mychart
helm chart save mychart  gcr.io/my-gcp-project/mychart # creates metadata in local folder ~/.helm/registry/
gcloud auth configure-docker # needed only once, adds some data in ~/.docker/config.json
docker login gcr.io/my-gcp-project/mychart
helm chart push  gcr.io/my-gcp-project/mychart

There is still a problem. There was not a tag associated to the chart in the registry. I expected latest. I had to add the tag manually from the GCR dashboard to be able to do a pull operation.

helm chart pull gcr.io/my-gcp-project/mychart:latest

Also the final :latest was mandatory, the command would fail without it.

In this comment time, neither docker.io or query.io can not use helm chart push command.

Hi @zioproto, I tried to reproduce your steps and I have this error (like @guycla)

$ helm package ~/mychart/
$ helm repo index .
$ set HELM_EXPERIMENTAL_OCI=1 # Set Windows varenv
$ helm chart save mychart gcr.io/myproject/mychart

$ helm chart push gcr.io/myproject/mychart:1.0.0
The push refers to repository [gcr.io/myproject/mychart]
ref:     gcr.io/myproject/mychart:1.0.0
digest:  f5c69de41df329c0774617f76af50fa85af7223ecd3f3734b8af32ae099a0597
size:    29.5 KiB
name:    mychart
version: 1.0.0
Error: failed to authorize: failed to fetch oauth token: unexpected status: 400 Bad Request

I have admin right access to my GCP project. And I’m successfully logged in GCR with docker login.

(helm v3.2.1)

Do you have any ideas ? 😃

Docker Hub is not currently supporting alternative content types at this time. Feel free to use one of the listed cloud providers that does support Helm’s content type.

Most cloud providers whitelist certain media types. Usually that means they only support docker images. The only two that we know that work at this time with helm chart push are Azure Container Registry and vanilla docker/distribution, but we’re working with the OCI to figure out how to get Helm’s published media types to be whitelisted with other providers including Docker Hub.

cc @jdolitsky