Skip to content

Commit 5b549c0

Browse files
authored
build: add image info properties (#3400)
1 parent c57760e commit 5b549c0

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.github/workflows/build-multiarch.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ jobs:
3333
- java8-graalvm-ce
3434
- java8-openj9
3535
- java8-jdk
36-
- java11
3736
include:
3837
# JAVA 23
3938
- variant: java23
@@ -75,11 +74,6 @@ jobs:
7574
baseImage: eclipse-temurin:17-jre-alpine
7675
platforms: linux/amd64
7776
mcVersion: 1.20.4
78-
# JAVA 11:
79-
- variant: java11
80-
baseImage: adoptopenjdk:11-jre-hotspot
81-
platforms: linux/amd64,linux/arm/v7,linux/arm64
82-
mcVersion: 1.16.5
8377
# JAVA 8: NOTE: Unable to go past 8u312 because of Forge dependencies
8478
- variant: java8
8579
baseImage: eclipse-temurin:8u312-b07-jre-focal
@@ -207,5 +201,8 @@ jobs:
207201
build-args: |
208202
BASE_IMAGE=${{ matrix.baseImage }}
209203
BUILD_FILES_REV=${{ steps.build-files-rev.outputs.REV }}
204+
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
205+
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
206+
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
210207
cache-from: type=gha,scope=${{ matrix.variant }}
211208
cache-to: type=gha,mode=max,scope=${{ matrix.variant }}

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,8 @@ RUN dos2unix /start* /auto/*
7878

7979
ENTRYPOINT [ "/start" ]
8080
HEALTHCHECK --start-period=2m --retries=2 --interval=30s CMD mc-health
81+
82+
ARG BUILDTIME=local
83+
ARG VERSION=local
84+
ARG REVISION=local
85+
RUN echo "buildtime=${BUILDTIME}\nversion=${VERSION}\nrevision=${REVISION}" > /etc/image.properties

scripts/start-configuration

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ isDebugging && set -x
3232
export HOME=/data
3333

3434
log "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
35+
log "Image info: $(paste -d, -s /etc/image.properties)"
3536

3637
if [ ! -e /data/eula.txt ]; then
3738
if ! isTrue "$EULA"; then

0 commit comments

Comments
 (0)