Artifact Hub Docker container image not recognised even though labels are there

36 Views Asked by At

I Have a docker container that I publish via github packages and I have provided the following labels as artifact hub requested:

error preparing package (tag: latest): 3 errors occurred:
* required metadata field not provided: org.opencontainers.image.created
* required metadata field not provided: org.opencontainers.image.description
* required metadata field not provided: io.artifacthub.package.readme-url

this is the error message

I am adding the packages at build time in the actions pipeline like so:

    - name: Extract Docker metadata
        id: meta
        uses: docker/[email protected]
        with:
          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
          labels: |
            org.opencontainers.image.source=${{ github.event.repository.clone_url }}
            org.opencontainers.image.created=${{ steps.current-time.outputs.time }}
            org.opencontainers.image.description=${{ secrets.IMAGE_DESCRIPTION }}
            io.artifacthub.package.readme-url=${{ secrets.README_URL }}

And my labels show up in this structure when inspecting them with docker locally:

    [
    {
        "Id": "id",
        "RepoTags": ["tag"],
        "RepoDigests": ["digest"],
        "Parent": "",
        "Comment": "buildkit.dockerfile.v0",
        "Created": "2024-02-13T08:22:35.270211021Z",
        "Container": "",
        "ContainerConfig": {},
        "DockerVersion": "",
        "Author": "",
        "Config": {
            "Labels": {
                "io.artifacthub.package.readme-url": "some readme url",
                "org.opencontainers.image.created": "2024-02-13T08:15:42.993Z",
                "org.opencontainers.image.description": "sample text",
                "org.opencontainers.image.licenses": "Apache-2.0",
                "org.opencontainers.image.revision": "b87daa04233fc010b4dc28e562b00cd62332e6be",
                "org.opencontainers.image.source": "http://source",
                "org.opencontainers.image.title": "title",
                "org.opencontainers.image.url": "https://myurl",
                "org.opencontainers.image.version": "v1.3.5"
            }
        },
        "Architecture": "amd64",
        "Os": "linux",

removed some redundant json sub-objects but this is the rough json structure I get.

What I am missing? Am I using an old docker build version?

I am also not too keen to provide the labels in the docker file like so:

    LABEL org.opencontainers.image.description DESCRIPTION
0

There are 0 best solutions below