Skip to content

Commit 7865334

Browse files
committed
chore: #66 Set org.opencontainers labels on container images
Signed-off-by: Laurent Broudoux <[email protected]>
1 parent 310212f commit 7865334

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.github/workflows/build-verify.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,19 @@ on:
1212
- '.gitignore'
1313
- 'LICENSE'
1414
- '*.md'
15-
15+
permissions: read-all
1616
jobs:
1717
build-verify-package:
1818
runs-on: ubuntu-latest
1919
environment: Build
2020
steps:
21+
- name: Get current date
22+
id: date
23+
#run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%S')"
24+
run: echo "date=$(date +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
25+
2126
- name: Checkout Code
22-
uses: actions/checkout@v2
27+
uses: actions/checkout@v4
2328

2429
- name: Setup Go
2530
uses: actions/setup-go@v2
@@ -67,4 +72,6 @@ jobs:
6772
--provenance=false \
6873
--build-arg TAG=$IMAGE_TAG \
6974
--file build/Dockerfile \
75+
--label "org.opencontainers.image.revision=${GITHUB_SHA}" \
76+
--label "org.opencontainers.image.created=${{ steps.date.outputs.date }}" \
7077
--tag=quay.io/microcks/microcks-cli:$IMAGE_TAG .

build/Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
1010
# Build image
1111
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.3-1475
1212

13-
MAINTAINER Laurent Broudoux <[email protected]>
13+
# Some version information
14+
LABEL maintainer="Laurent Broudoux <[email protected]>" \
15+
org.opencontainers.image.authors="Laurent Broudoux <[email protected]>" \
16+
org.opencontainers.image.title="Microcks CLI" \
17+
org.opencontainers.image.description="Microcks is Open Source cloud-native native tool for API Mocking and Testing" \
18+
org.opencontainers.image.licenses="Apache-2.0" \
19+
org.opencontainers.image.documentation="https://github.com/microcks/microcks-cli" \
20+
io.artifacthub.package.readme-url="https://raw.githubusercontent.com/microcks/microcks-cli/main/README.md"
1421

1522
ENV CLI=/usr/local/bin/microcks-cli \
1623
USER_UID=1001 \

0 commit comments

Comments
 (0)