Add org.opencontainers.image.source to Dockerfiles (#9211)
### Purpose The OCI image spec specifies well-defined [annotations](https://github.com/opencontainers/image-spec/blob/main/annotations.md) that can be added to images. Theses annotations can then be used by other tools to gather more information of an image. This PR adds the `org.opencontainers.image.source` to allow tools such as [renovate](https://github.com/renovatebot/renovate) to find the release notes of a give version. ~~I've only done this change for `Dockerfile`. Should I also add the label to the other dockerfiles?~~ I've now added the source annotations to all `Dockerfile`s & action workflows. ### Testing None, change was done by following the [renovate documentation](https://docs.renovatebot.com/modules/datasource/docker/).
This commit is contained in:
@@ -808,6 +808,7 @@ jobs:
|
||||
tags=${{ matrix.image }}:edge
|
||||
fi
|
||||
echo "DOCKER_TAGS=$tags" >> $GITHUB_ENV
|
||||
echo "VERSION=$version" >> $GITHUB_ENV
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
@@ -817,6 +818,9 @@ jobs:
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/7
|
||||
push: ${{ env.DOCKER_PUSH == 'true' }}
|
||||
tags: ${{ env.DOCKER_TAGS }}
|
||||
outputs: |
|
||||
annotation.org.opencontainers.image.version="${{ env.VERSION }}"
|
||||
annotation.org.opencontainers.image.revision="${{ github.sha }}"
|
||||
|
||||
#
|
||||
# Check for known vulnerabilities in Go dependencies
|
||||
|
||||
Reference in New Issue
Block a user