Skip to content

Commit

Permalink
Merge pull request opendatahub-io#32 from israel-hdez/fix-for-ci-build
Browse files Browse the repository at this point in the history
Adjust Dockerfile to be more friendly with openshift-ci
  • Loading branch information
Jooho authored Aug 31, 2023
2 parents 7f33789 + b63cb9b commit 1d2deb3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
.cache
.dockerignore
.env
.git
.github
.gitignore
.idea
Expand Down
19 changes: 13 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ RUN --mount=type=cache,target=/root/.cache/microdnf:rw \
tar \
gzip \
maven \
git \
&& true

# Install etcd -- used for CI tests
Expand Down Expand Up @@ -74,6 +75,11 @@ ENV MAVEN_OPTS="-Dfile.encoding=UTF8"
RUN --mount=type=cache,target=/root/.m2 \
mvn -B package -DskipTests=true --file pom.xml

# Assume that source code comes from a Git repository
RUN echo "$(date '+%Y%m%d')-$(git rev-parse HEAD | cut -c -5)" > target/dockerhome/build-version && \
echo "$(git rev-parse HEAD)" > target/dockerhome/release && \
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


###############################################################################
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.6 AS runtime
Expand Down Expand Up @@ -124,18 +130,19 @@ RUN --mount=type=cache,target=/root/.cache/microdnf:rw \

# wait to create commit-specific LABEL until end of the build to not unnecessarily
# invalidate the cached image layers
ARG imageVersion
ARG buildId
ARG commitSha
# ARG imageVersion
# ARG buildId
# ARG commitSha

RUN echo "${buildId}" > /opt/kserve/mmesh/build-version
# Generated at build stage
# RUN echo "${buildId}" > /opt/kserve/mmesh/build-version

LABEL name="model-mesh" \
vendor="KServe" \
version="${imageVersion}" \
# version="${imageVersion}" \
summary="Core model-mesh sidecar image" \
description="Model-mesh is a distributed LRU cache for serving runtime models" \
release="${commitSha}" \
# release="${commitSha}" \
maintainer="nickhill@us.ibm.com"

EXPOSE 8080
Expand Down

0 comments on commit 1d2deb3

Please sign in to comment.