Skip to content

Commit

Permalink
Merge pull request #37 from telicent-oss/core_673_update_base_image
Browse files Browse the repository at this point in the history
[CORE-673] Updating dockerfile to use Telicent crafted base image
  • Loading branch information
TelicentPaul authored Feb 12, 2025
2 parents 568af3a + 6145e39 commit f3c3ae9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ jobs:
USES_MAVEN: true
# Container image is built for Java 21 to be as up to date as possible
JAVA_VERSION: 21
GRYPE_SECURITY_ISSUES_BLOCK_ONLY_IF_FIX_AVAILABLE: true
secrets: inherit
28 changes: 15 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
#
# Copyright (C) Telicent Ltd
#

# syntax=docker/dockerfile:1.7

FROM eclipse-temurin:21-jre as rdf-abac-evaluator
FROM telicent/telicent-java21:1.1.5 AS rdf-abac-evaluator

WORKDIR /app
USER root

# Define argument with a default value to prevent build failures
ARG PROJECT_VERSION

RUN mkdir /config
# Set up directories and user in a single efficient step
RUN mkdir -p /app /config /opt/telicent/sbom && \
chown -R user:user /app /config /opt/telicent/sbom

RUN useradd -Mg root telicent-service
USER telicent-service
WORKDIR /app

COPY src/main/resources/* /config/
# Copy config and application files
COPY --chown=user:user src/main/resources/ /config/
COPY --chown=user:user target/rdf-abac-evaluator-${PROJECT_VERSION}.jar /app/app.jar
COPY --chown=user:user target/rdf-abac-evaluator-${PROJECT_VERSION}-bom.json /opt/telicent/sbom/

ARG PROJECT_VERSION
USER user

COPY target/rdf-abac-evaluator-${PROJECT_VERSION}.jar /app/app.jar
ENTRYPOINT java -cp /app/app.jar $CLASSNAME $ARGS
ENTRYPOINT /usr/bin/dumb-init -v --single-child -- java -cp /app/app.jar $CLASSNAME $ARGS

0 comments on commit f3c3ae9

Please # to comment.