Skip to content

Conversation

@halkeye
Copy link
Contributor

@halkeye halkeye commented Oct 3, 2024

Description

Add some of the standard opencontainer docker labels.

Motivation and Context

Tools like renovate and dependabot use docker labels to build changelogs when doing an update PR. (halkeye/home-k8s#331 as example). They compare the new docker image to the latest tag, and grab various metadata. If it can, it will also enrich the messages via github releases changelogs.

A working example

regctl image config --format '{{ jsonPretty .Config.Labels }}' ghcr.io/plankanban/planka:latest
{
  "org.opencontainers.image.created": "2024-10-02T12:21:17.811Z",
  "org.opencontainers.image.description": "The realtime kanban board for workgroups built with React and Redux.",
  "org.opencontainers.image.licenses": "AGPL-3.0",
  "org.opencontainers.image.revision": "19935e52af46ee95521593af60393861066421ad",
  "org.opencontainers.image.source": "https://github.com/plankanban/planka",
  "org.opencontainers.image.title": "planka",
  "org.opencontainers.image.url": "https://github.com/plankanban/planka",
  "org.opencontainers.image.version": "1.23.1"
}

With this PR, I was able to quickly add all but created (as it should be timestamp) and revision (as it should be a sha i think)

regctl image config --format '{{ jsonPretty .Config.Labels }}' registry.digitalocean.com/halkeye/oauth2-proxy:v7.7.0-1-g825da4ae-dirty
{
  "org.opencontainers.image.description": "A reverse proxy that provides authentication with Google, Azure, OpenID Connect and many more identity providers.",
  "org.opencontainers.image.licenses": "MIT",
  "org.opencontainers.image.source": "https://github.com/oauth2-proxy/oauth2-proxy",
  "org.opencontainers.image.title": "oauth2-proxy",
  "org.opencontainers.image.url": "https://github.com/oauth2-proxy/oauth2-proxy",
  "org.opencontainers.image.version": "v7.7.0-1-g825da4ae-dirty"
}

How Has This Been Tested?

make docker docker-push REGISTRY=registry.digitalocean.com/halkeye DOCKER_BUILD_PLATFORM=linux/amd64 DOCKER_BUILD_PLATFORM_ALPINE=linux/amd64
regctl image config --format '{{ jsonPretty .Config.Labels }}' registry.digitalocean.com/halkeye/oauth2-proxy:v7.7.0-1-g825da4ae-dirty

Checklist:

  • My change requires a change to the documentation or CHANGELOG.
  • I have updated the documentation/CHANGELOG accordingly.
  • I have created a feature (non-master) branch for my PR.
  • I have written tests for my code changes.

@halkeye halkeye requested a review from a team as a code owner October 3, 2024 05:06
@github-actions github-actions bot added the docker label Oct 3, 2024
@halkeye
Copy link
Contributor Author

halkeye commented Oct 3, 2024

I'm not sure how to add tests, or if changelogs are needed

Copy link
Member

@tuunit tuunit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this changes how the build artifacts will look. I would like to see a CHANGELOG entry for it :)

@tuunit
Copy link
Member

tuunit commented Oct 3, 2024

I'm not sure how to add tests, or if changelogs are needed

The CI build should be enough for testing :)

@halkeye
Copy link
Contributor Author

halkeye commented Oct 3, 2024

I would like to see a CHANGELOG entry for it :)

can you give me pointers on that? Its just the changelog file right? Maybe something under important notes?

@tuunit
Copy link
Member

tuunit commented Oct 3, 2024

I would like to see a CHANGELOG entry for it :)

can you give me pointers on that? Its just the changelog file right? Maybe something under important notes?

Please just add a single line in the section Changes since v7.7.0 look at the previous release to check the syntax.

The other sections like important notes etc. are updated by us the maintainers before we publish a release.

@halkeye halkeye force-pushed the add-docker-labels branch from 2469e0a to 8fbf3d0 Compare October 4, 2024 01:12
@github-actions github-actions bot added the docs label Oct 4, 2024
tuunit
tuunit previously approved these changes Oct 6, 2024
@tuunit
Copy link
Member

tuunit commented Oct 6, 2024

Will be merged after the bugfix release for #2802 / #2803

@tuunit tuunit changed the title Add standard opencontainer docker labels doc: add standard opencontainer docker labels Oct 9, 2024
@tuunit tuunit merged commit ab448cf into oauth2-proxy:master Oct 9, 2024
jjlakis pushed a commit to jjlakis/oauth2-proxy that referenced this pull request Oct 19, 2024
antoniocasagrande-airia pushed a commit to antoniocasagrande-airia/oauth2-proxy that referenced this pull request Dec 11, 2024
@tuunit tuunit added this to the v7.8.0 milestone Jan 12, 2025
g-linville pushed a commit to obot-platform/oauth2-proxy that referenced this pull request Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants