@@ -44,6 +44,7 @@ RUN --mount=type=cache,target=/root/.cache/microdnf:rw \
44
44
tar \
45
45
gzip \
46
46
maven \
47
+ git \
47
48
&& true
48
49
49
50
# Install etcd -- used for CI tests
@@ -74,6 +75,11 @@ ENV MAVEN_OPTS="-Dfile.encoding=UTF8"
74
75
RUN --mount=type=cache,target=/root/.m2 \
75
76
mvn -B package -DskipTests=true --file pom.xml
76
77
78
+ # Assume that source code comes from a Git repository
79
+ RUN echo "$(date '+%Y%m%d')-$(git rev-parse HEAD | cut -c -5)" > target/dockerhome/build-version && \
80
+ echo "$(git rev-parse HEAD)" > target/dockerhome/release && \
81
+ echo "$(git branch --show-current|sed 's/^release-//g')-$(git branch --show-current)_$(date '+%Y%m%d')-$(git rev-parse HEAD | cut -c -5)" > target/dockerhome/version
82
+
77
83
78
84
# ##############################################################################
79
85
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.6 AS runtime
@@ -124,18 +130,19 @@ RUN --mount=type=cache,target=/root/.cache/microdnf:rw \
124
130
125
131
# wait to create commit-specific LABEL until end of the build to not unnecessarily
126
132
# invalidate the cached image layers
127
- ARG imageVersion
128
- ARG buildId
129
- ARG commitSha
133
+ # ARG imageVersion
134
+ # ARG buildId
135
+ # ARG commitSha
130
136
131
- RUN echo "${buildId}" > /opt/kserve/mmesh/build-version
137
+ # Generated at build stage
138
+ # RUN echo "${buildId}" > /opt/kserve/mmesh/build-version
132
139
133
140
LABEL name="model-mesh" \
134
141
vendor="KServe" \
135
- version="${imageVersion}" \
142
+ # version="${imageVersion}" \
136
143
summary="Core model-mesh sidecar image" \
137
144
description="Model-mesh is a distributed LRU cache for serving runtime models" \
138
- release="${commitSha}" \
145
+ # release="${commitSha}" \
139
146
140
147
141
148
EXPOSE 8080
0 commit comments