Skip to content

Commit a69537d

Browse files
committed
fix: add labels to OCI image
With this, we're being good OCI citizens (or something like that) by telling people where to find the source for the image. Plus, renovate uses the org.opencontainers.image.source label to find the source for changelogs, so it will now also show changelogs.
1 parent 497d3d9 commit a69537d

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.goreleaser.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,9 @@ dockers:
4343
- "ghcr.io/envelope-zero/backend:v{{ .Major }}"
4444
- "ghcr.io/envelope-zero/backend:v{{ .Major }}.{{ .Minor }}"
4545
- "ghcr.io/envelope-zero/backend:latest"
46+
47+
build_flag_templates:
48+
- "--label=org.opencontainers.image.created={{.Date}}"
49+
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
50+
- "--label=org.opencontainers.image.title={{.ProjectName}}"
51+
- "--label=org.opencontainers.image.version={{.Version}}"

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,13 @@ FROM scratch
1616
WORKDIR /
1717
COPY --from=builder /app/backend /backend
1818
ENTRYPOINT ["/backend"]
19+
20+
# Keep "maintainer" and "org.opencontainers.image.authors" in sync
21+
LABEL "maintainer"="Envelope Zero Maintainers <[email protected]>"
22+
LABEL "org.opencontainers.image.authors"="Envelope Zero Maintainers <[email protected]>"
23+
LABEL "org.opencontainers.image.description"="Backend for Envelope Zero"
24+
LABEL "org.opencontainers.image.documentation"="https://github.com/envelope-zero/backend"
25+
LABEL "org.opencontainers.image.licenses"="AGPL-3.0-or-later"
26+
LABEL "org.opencontainers.image.source"="https://github.com/envelope-zero/backend"
27+
LABEL "org.opencontainers.image.url"="https://github.com/envelope-zero/backend"
28+
LABEL "org.opencontainers.image.vendor"="Envelope Zero Maintainers"

0 commit comments

Comments
 (0)