2022-02-01 08:42:09 +00:00
|
|
|
FROM registry.access.redhat.com/ubi8-minimal AS build-env
|
|
|
|
|
2022-03-22 08:22:48 +00:00
|
|
|
ENV KEYCLOAK_VERSION 999-SNAPSHOT
|
2022-02-01 08:42:09 +00:00
|
|
|
ARG KEYCLOAK_DIST=https://github.com/keycloak/keycloak/releases/download/$KEYCLOAK_VERSION/keycloak-$KEYCLOAK_VERSION.tar.gz
|
|
|
|
|
|
|
|
RUN microdnf install -y tar gzip
|
|
|
|
|
|
|
|
ADD $KEYCLOAK_DIST /tmp/keycloak/
|
|
|
|
|
|
|
|
# The next step makes it uniform for local development and upstream built.
|
|
|
|
# If it is a local tar archive then it is unpacked, if from remote is just downloaded.
|
|
|
|
RUN (cd /tmp/keycloak && \
|
|
|
|
tar -xvf /tmp/keycloak/keycloak-*.tar.gz && \
|
|
|
|
rm /tmp/keycloak/keycloak-*.tar.gz) || true
|
|
|
|
|
2022-03-17 17:50:38 +00:00
|
|
|
RUN mv /tmp/keycloak/keycloak-* /opt/keycloak && mkdir -p /opt/keycloak/data
|
2022-02-01 08:42:09 +00:00
|
|
|
|
2022-02-10 07:01:51 +00:00
|
|
|
RUN chmod -R g+rwX /opt/keycloak
|
|
|
|
|
2022-02-01 08:42:09 +00:00
|
|
|
FROM registry.access.redhat.com/ubi8-minimal
|
2022-04-22 12:57:39 +00:00
|
|
|
ENV LANG en_US.UTF-8
|
2022-02-01 08:42:09 +00:00
|
|
|
|
2022-02-10 07:01:51 +00:00
|
|
|
COPY --from=build-env --chown=1000:0 /opt/keycloak /opt/keycloak
|
2022-02-01 08:42:09 +00:00
|
|
|
|
|
|
|
RUN microdnf update -y && \
|
2022-04-22 12:57:39 +00:00
|
|
|
microdnf install -y --nodocs java-11-openjdk-headless glibc-langpack-en && microdnf clean all && rm -rf /var/cache/yum/* && \
|
2022-02-01 08:42:09 +00:00
|
|
|
echo "keycloak:x:0:root" >> /etc/group && \
|
2022-02-10 07:01:51 +00:00
|
|
|
echo "keycloak:x:1000:0:keycloak user:/opt/keycloak:/sbin/nologin" >> /etc/passwd
|
2022-02-01 08:42:09 +00:00
|
|
|
|
|
|
|
USER 1000
|
|
|
|
|
|
|
|
EXPOSE 8080
|
|
|
|
EXPOSE 8443
|
|
|
|
|
|
|
|
ENTRYPOINT [ "/opt/keycloak/bin/kc.sh" ]
|