Skip to content

Commit 75b4bf4

Browse files
committed
support keycloak 24.0.1
1 parent b74bd23 commit 75b4bf4

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

build/keycloak/Dockerfile

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
##################################################
22
# Step 1 - Build an optimized image
33
##################################################
4-
FROM quay.io/keycloak/keycloak:20.0.3 as builder
4+
FROM quay.io/keycloak/keycloak:24.0.1 as builder
55

66
# These options can be modified to produce a different
77
# optimized build.
@@ -26,16 +26,25 @@ COPY themes/ /opt/keycloak/themes
2626
RUN /opt/keycloak/bin/kc.sh build
2727

2828
##################################################
29-
# Step 2 - Copy optimized build into running image
29+
# Step 2 - Add required dependencies
30+
# https://www.keycloak.org/server/containers
3031
##################################################
31-
FROM quay.io/keycloak/keycloak:20.0.3
32+
FROM registry.access.redhat.com/ubi9 AS ubi-micro-build
33+
RUN mkdir -p /mnt/rootfs
3234

33-
# parses ecs metadata
34-
USER root
35-
RUN microdnf update -y && \
36-
microdnf install -y jq && \
37-
microdnf clean all
35+
# curl and jq used to parse ecs metadata
36+
RUN dnf update -y && \
37+
dnf install --installroot /mnt/rootfs curl jq --releasever 9 --setopt install_weak_deps=false --nodocs -y && \
38+
dnf --installroot /mnt/rootfs clean all && \
39+
rpm --root /mnt/rootfs -e --nodeps setup
40+
41+
###################################################################
42+
# Step 3 - Copy optimized build and dependencies into running image
43+
###################################################################
44+
FROM quay.io/keycloak/keycloak:24.0.1
3845

46+
USER root
47+
COPY --from=ubi-micro-build /mnt/rootfs /
3948
USER keycloak
4049
COPY --from=builder /opt/keycloak /opt/keycloak
4150

build/keycloak/docker-entrypoint.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ if [ -z "${HOSTNAME}" ]; then
2222
HOSTNAME="localhost"
2323
fi
2424

25-
exec /opt/keycloak/bin/kc.sh start --optimized "$@"
25+
# https://docs.aws.amazon.com/elasticloadbalancing/latest/application/x-forwarded-headers.html
26+
exec /opt/keycloak/bin/kc.sh start --optimized --proxy-headers xforwarded "$@"
2627
exit $?

0 commit comments

Comments
 (0)