-
Notifications
You must be signed in to change notification settings - Fork 148
/
Dockerfile
36 lines (24 loc) · 1.08 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Can be adjusted with docker build --build-arg RUNTIME_IMAGE=mirror.com/openjdk:21
ARG BUILDER_IMAGE=eclipse-temurin:21-jdk
ARG RUNTIME_IMAGE=eclipse-temurin:21-jre
FROM ${BUILDER_IMAGE} AS BUILDER
WORKDIR /app/
ARG KEYCLOAK_VERSION=26.0.5
ARG KEYCLOAK_CLIENT_VERSION=26.0.2
ARG MAVEN_CLI_OPTS="-ntp -B"
COPY .mvn .mvn
COPY mvnw .
COPY pom.xml .
RUN ./mvnw ${MAVEN_CLI_OPTS} -q dependency:go-offline
COPY src src
RUN ./mvnw ${MAVEN_CLI_OPTS} clean package -DskipTests \
-Dkeycloak.version=${KEYCLOAK_VERSION} -Dkeycloak.client.version=${KEYCLOAK_CLIENT_VERSION} \
-Dlicense.skipCheckLicense -Dcheckstyle.skip -Dmaven.test.skip=true -Dmaven.site.skip=true \
-Dmaven.javadoc.skip=true -Dmaven.gitcommitid.skip=true
FROM ${RUNTIME_IMAGE}
ARG JAR=./target/keycloak-config-cli.jar
ENV JAVA_OPTS="" KEYCLOAK_SSL_VERIFY=true IMPORT_FILES_LOCATIONS=file:/config/*
# $0 represents the first CLI arg which is not inside $@
ENTRYPOINT exec java $JAVA_OPTS -jar /app/keycloak-config-cli.jar $0 $@
COPY --from=BUILDER /app/target/keycloak-config-cli.jar /app/keycloak-config-cli.jar
USER 65534