Skip to content

Commit de0f69f

Browse files
committed
chore: add relevant build metadata to the image
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
1 parent b173d11 commit de0f69f

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/push-to-registry.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ jobs:
4343
echo "version=$VERSION" >> $GITHUB_OUTPUT
4444
echo "Package version: $VERSION"
4545
46+
- name: Get image metadata
47+
id: image-meta
48+
run: |
49+
echo "revision=${{ github.sha }}" >> $GITHUB_OUTPUT
50+
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
51+
4652
- name: Set up Docker Buildx
4753
uses: docker/setup-buildx-action@v3
4854

@@ -75,5 +81,9 @@ jobs:
7581
push: true
7682
tags: ${{ steps.meta.outputs.tags }}
7783
labels: ${{ steps.meta.outputs.labels }}
84+
build-args: |
85+
IMAGE_VERSION=${{ steps.package-version.outputs.version }}
86+
IMAGE_REVISION=${{ steps.image-meta.outputs.revision }}
87+
IMAGE_CREATED=${{ steps.image-meta.outputs.created }}
7888
cache-from: type=gha
7989
cache-to: type=gha,mode=max

docker-image/Dockerfiles/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,22 @@ USER default
4646
# second stage
4747
FROM registry.access.redhat.com/ubi9/nodejs-20-minimal
4848

49+
# Build arguments for metadata
50+
ARG IMAGE_VERSION
51+
ARG IMAGE_REVISION
52+
ARG IMAGE_CREATED
53+
54+
# Open Container Initiative (OCI) metadata labels
4955
LABEL org.opencontainers.image.source=https://github.com/guacsec/trustify-da-javascript-client
56+
LABEL org.opencontainers.image.description="Trustify Dependency Analytics JavaScript Client - Container image for dependency analysis and vulnerability scanning supporting Maven, NPM, Golang, and Python ecosystems"
57+
LABEL org.opencontainers.image.licenses=Apache-2.0
58+
LABEL org.opencontainers.image.title="Trustify Dependency Analytics JavaScript Client"
59+
LABEL org.opencontainers.image.vendor="guacsec"
60+
LABEL org.opencontainers.image.url=https://github.com/guacsec/trustify-da-javascript-client
61+
LABEL org.opencontainers.image.documentation=https://github.com/guacsec/trustify-da-javascript-client#README.md
62+
LABEL org.opencontainers.image.version="${IMAGE_VERSION}"
63+
LABEL org.opencontainers.image.revision="${IMAGE_REVISION}"
64+
LABEL org.opencontainers.image.created="${IMAGE_CREATED}"
5065

5166
# contains pip feeze --all data, base64 encoded
5267
ENV TRUSTIFY_DA_PIP_FREEZE=''

0 commit comments

Comments
 (0)