Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use OCI Label defaults on Docker images #145

Merged
merged 3 commits into from
Dec 15, 2023

Conversation

hypery2k
Copy link
Contributor

According to OCI these labels should be applied: https://github.com/opencontainers/image-spec/blob/main/annotations.md

I didn't found the docker image build, maybe you're using docker hub build. Idea would be to pass BUILD_DATE and APP_VERSION as build arguments

@Luzifer
Copy link
Owner

Luzifer commented Nov 8, 2023

Hmm I don't really get the intention behind this change. Please explain the benefit of having those tags set. Is there anything out there using those labels or are they just present for the sake of being present? (Haven't seen anything - including myself - using them out there…)

Regarding those two args: They will be always empty. The build system does not know anything about the contents of the container and will not know anything about it (auto-generated generic build system used for dozens of images).

Aside of this: There is a missing = in the version label.

@hypery2k
Copy link
Contributor Author

you're right. I fixed the typo

The benefit is, that these labels are standardized and can be crawled by tools like artifacthub and snyk.io: https://snyk.io/de/blog/how-and-when-to-use-docker-labels-oci-container-annotations/

@hypery2k
Copy link
Contributor Author

BTW: I deployed a simple OTS Helm chart: https://artifacthub.io/packages/helm/ots/ots

@Luzifer
Copy link
Owner

Luzifer commented Nov 18, 2023

Hmm still not sure about the ARGs… …I can agree on the static values. I could agree on a version set through patch on release (so the tag will always have the correct version, latest will "lie" about the version until the next release)… But setting them as ARGs will just lead to empty labels which are useless.

So what do you think?

  • Removing the build-time, setting version through on-release patcher
  • Removing build-time and version
  • Keeping it the way it was before this PR

@hypery2k
Copy link
Contributor Author

I agree with you, that empty values would be useless.

Regarding the version: Are you using docker auto build? I think you can set build args there. So would prefer option 1

@Luzifer Luzifer changed the title Use OCI Label defaults Use OCI Label defaults on Docker images Dec 15, 2023
@Luzifer Luzifer merged commit 142ca55 into Luzifer:master Dec 15, 2023
3 checks passed
@Luzifer Luzifer added this to the 1.12.0 milestone Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants