ori-edge / k8s_gateway

A CoreDNS plugin to resolve all types of external Kubernetes resources
Apache License 2.0
295 stars 64 forks source link

May we add open containers labels to the Dockerfile? #106

Open mstoetzer opened 2 years ago

mstoetzer commented 2 years ago

It could be a nice addition to provide official opencontainers labels in the Dockerfile:

LABEL org.opencontainers.image.authors="xxxx" \
      org.opencontainers.image.source="https://github.com/ori-edge/k8s_gateway" \
      org.opencontainers.image.description="A CoreDNS plugin that is very similar to [k8s_external](https://coredns.io/plugins/k8s_external/) but supporting all types of Kubernetes external resources" \
      org.opencontainers.image.documentation="https://github.com/ori-edge/k8s_gateway" \
      org.opencontainers.image.licenses="Apache License 2.0" \
      org.opencontainers.image.title="k8s_gateway" \
      org.opencontainers.image.url="https://github.com/ori-edge/k8s_gateway" \
      org.opencontainers.image.vendor="Ori Industries 1 Ltd"

This is useful for various automation tools (e.g. dependabot or renovatebot) that are able to extract the release notes from github and other information. When these tools update the dockerimage version, they can extract the release notes from the source label and provide it in the pullrequest. See the renovate docs

What do you think? What values should those labels have?

mstoetzer commented 2 years ago

As for reference: https://github.com/opencontainers/image-spec/blob/main/annotations.md

networkop commented 2 years ago

it sounds pretty cool. Do you have any good examples where we can borrow this for GH actions?

networkop commented 2 years ago

This looks like a good pointer https://github.com/humio/humio-operator/pull/449/files

mstoetzer commented 2 years ago

Haven't used them in GH actions before. I put them directly into the Dockerfile. But yes, putting them as build args could also work to avoid bloating the Dockerfile. I'm fine with both.

Well, there is a plugin for GH actions: https://github.com/marketplace/actions/docker-metadata-action