forked from adorsys/keycloak-config-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (22 loc) · 1012 Bytes
/
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
# Can be adjusted with docker build --build-arg RUNTIME_IMAGE=mirror.com/openjdk:17
ARG BUILDER_IMAGE=eclipse-temurin:17-jdk
ARG RUNTIME_IMAGE=eclipse-temurin:17-jre
FROM ${BUILDER_IMAGE} AS BUILDER
WORKDIR /app/
ARG KEYCLOAK_VERSION=19.0.1
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} \
-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