keycloak/Containerfile
Sebastian Hugentobler 64c5f8f9bb
Some checks failed
Build Multiarch Container Image / call-reusable-workflow (push) Failing after 51s
push to 26.0.7
2025-01-10 13:33:21 +01:00

29 lines
911 B
Docker

FROM docker.io/alpine:3.21 AS builder
ENV VERSION=26.0.7
ENV SHA256_SUM=a6d770bbf55625781f1225a54a130839cdc1dd4ad5b3b4bbb18c9ac8bca8f8ae
RUN wget "https://github.com/keycloak/keycloak/releases/download/$VERSION/keycloak-$VERSION.tar.gz"
RUN echo "$SHA256_SUM keycloak-$VERSION.tar.gz" | sha256sum -c - || exit 1
RUN mkdir -p /keycloak
RUN tar xvf keycloak-$VERSION.tar.gz -C /keycloak --strip 1
FROM docker.io/thallian/alpine-s6:3.21-3.2.0.2
ENV JAVA_OPTS_APPEND="-Djava.net.preferIPv4Stack=false -Djava.net.preferIPv6Addresses=true"
RUN addgroup -g 2222 keycloak
RUN adduser -h /home/keycloak -u 2222 -D -G keycloak keycloak
RUN apk add --no-cache \
openjdk21-jre-headless \
bash
COPY --from=builder --chown=keycloak:keycloak /keycloak /home/keycloak/server
RUN /home/keycloak/server/bin/kc.sh build --db=postgres --metrics-enabled=true
RUN chown -R keycloak:keycloak /home/keycloak
ADD /rootfs /