generated from telekom/reuse-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.multi-stage
47 lines (29 loc) · 972 Bytes
/
Dockerfile.multi-stage
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
37
38
39
40
41
42
43
44
45
46
47
# SPDX-FileCopyrightText: 2023 Deutsche Telekom AG
#
# SPDX-License-Identifier: Apache-2.0
#desired version of Keycloak
ARG BASE_IMAGE_TAG=21.1.2
FROM openjdk:15-jdk-slim AS extensionbuilder
RUN apt-get install -y bash
RUN mkdir -p /app
ADD extensions /app/extensions/
RUN mkdir -p /app/providers
WORKDIR /app/extensions
RUN ./build.sh
FROM quay.io/keycloak/keycloak:$BASE_IMAGE_TAG AS builder
LABEL description="Keycloak Docker image bundled with extensions"
# Enable health and metrics support
ENV KC_HEALTH_ENABLED=true
ENV KC_METRICS_ENABLED=true
ENV KC_CACHE_STACK=kubernetes
# Configure a database vendor
ENV KC_DB=postgres
ENV KC_HTTP_RELATIVE_PATH=/auth
COPY --from=extensionbuilder /app/providers/ /opt/keycloak/providers/
ADD themes /opt/keycloak/providers/
WORKDIR /opt/keycloak
RUN /opt/keycloak/bin/kc.sh build --cache=ispn
FROM quay.io/keycloak/keycloak:$BASE_IMAGE_TAG
COPY --from=builder /opt/keycloak/ /opt/keycloak/
USER root
USER 1000