Add org.opencontainers.image.source label (#193)
Two image-label fixes: - Add `org.opencontainers.image.source` so tools like renovate can retrieve release notes from the source repo. - Re-declare `ARG VERSION` in the final stage. `ARG` after `FROM` is stage-scoped, so the builder-stage `VERSION` never reached the final stage and `org.opencontainers.image.version` expanded to an empty string in published images. Closes #192 --- This PR was written with the help of Claude Opus 4.7 Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/193 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-committed-by: silverwind <me@silverwind.io>
This commit is contained in:
@@ -22,11 +22,14 @@ RUN --mount=type=cache,target=/go/pkg/mod \
|
||||
# Final stage
|
||||
FROM gcr.io/distroless/static-debian12:nonroot
|
||||
|
||||
ARG VERSION=dev
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=builder --chown=nonroot:nonroot /app/gitea-mcp .
|
||||
|
||||
USER nonroot:nonroot
|
||||
|
||||
LABEL org.opencontainers.image.version="${VERSION}"
|
||||
LABEL org.opencontainers.image.source="https://gitea.com/gitea/gitea-mcp"
|
||||
|
||||
CMD ["/app/gitea-mcp"]
|
||||
|
||||
Reference in New Issue
Block a user