Keycloak 24.0. Проблема запуска контейнера на старом оборудовании
При сборке контейнера с keycloak версии 24.0 (Dockerfile от разработчиков) возник конфликт оборудования:
> [keycloak builder 5/5] RUN /opt/keycloak/bin/kc.sh build:
5.423 Fatal glibc error: CPU does not support x86-64-v2
------
failed to solve: process "/bin/sh -c /opt/keycloak/bin/kc.sh build" did not complete successfully: exit code: 127
Пытаюсь собрать другими вариантами:
1.Dockerfile:
ARG DIST=amazonlinux
FROM amazoncorretto:17 AS base
# ARG KEYCLOAK_VERSION 24.0.0-SNAPSHOT
# ARG KEYCLOAK_DIST=https://github.com/keycloak/keycloak/releases/download/$KEYCLOAK_VERSION/keycloak-$KEYCLOAK_VERSION.tar.gz
ARG KEYCLOAK_DIST=keycloak-24.0.tar.gz
COPY $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 set -eux; \
yum -y install tar zip gzip ; \
cd /tmp/keycloak ; \
ls -la ; \
tar -xvf keycloak-*.tar.gz ; \
rm -f keycloak-*.tar.gz ; \
mv keycloak-* /opt/keycloak ; \
mkdir -p /opt/keycloak/data ; \
chmod -R g+rwX /opt/keycloak
FROM amazoncorretto:17 AS dist-amazonlinux
# Install curl. May be useful in heatlcheck
RUN set -eux; \
yum -y install curl ; \
yum clean all ; \
rm -rf /var/cache/yum
FROM amazoncorretto:17-alpine AS dist-alpine
# Install bash for kc.sh script and curl. Curl may be useful in heatlcheck
RUN set -eux ; \
apk add --no-cache bash curl
FROM dist-${DIST}
ENV LANG en_US.UTF-8
COPY --from=base --chown=1000:0 /opt/keycloak /opt/keycloak
RUN echo "keycloak:x:0:root" >> /etc/group && \
echo "keycloak:x:1000:0:keycloak user:/opt/keycloak:/sbin/nologin" >> /etc/passwd
USER 1000
EXPOSE 8080
EXPOSE 8443
ENTRYPOINT [ "/opt/keycloak/bin/kc.sh" ]
При запуске получаю ошибку путей:
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/opt/keycloak/bin/kc.sh": stat /opt/keycloak/bin/kc.sh: no such file or directory: unknown
2.Dockerfile:
FROM registry.access.redhat.com/ubi9 AS ubi-micro-build
ENV KEYCLOAK_VERSION 24.0.0
# ARG KEYCLOAK_DIST=https://github.com/keycloak/keycloak/releases/download/$KEYCLOAK_VERSION/keycloak-$KEYCLOAK_VERSION.tar.gz
ARG KEYCLOAK_DIST=keycloak-24.0.tar.gz
RUN dnf install -y tar gzip
COPY $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
RUN mv /tmp/keycloak/keycloak-* /opt/keycloak && mkdir -p /opt/keycloak/data
RUN chmod -R g+rwX /opt/keycloak
ADD ubi-null.sh /tmp/
RUN bash /tmp/ubi-null.sh java-21-openjdk-headless glibc-langpack-en findutils
FROM registry.access.redhat.com/ubi9-micro
ENV LANG en_US.UTF-8
# Flag for determining app is running in container
ENV KC_RUN_IN_CONTAINER true
COPY --from=ubi-micro-build /tmp/null/rootfs/ /
COPY --from=ubi-micro-build --chown=1000:0 /opt/keycloak /opt/keycloak
RUN echo "keycloak:x:0:root" >> /etc/group && \
echo "keycloak:x:1000:0:keycloak user:/opt/keycloak:/sbin/nologin" >> /etc/passwd
USER 1000
EXPOSE 8080
EXPOSE 8443
EXPOSE 9000
ENTRYPOINT [ "/opt/keycloak/bin/kc.sh" ]
# common labels
ARG KEYCLOAK_VERSION
ARG KEYCLOAK_URL="https://www.keycloak.org/"
ARG KEYCLOAK_TAGS="keycloak security identity"
ARG KEYCLOAK_MAINTAINER=${KEYCLOAK_URL}
ARG KEYCLOAK_VENDOR=${KEYCLOAK_MAINTAINER}
LABEL maintainer=${KEYCLOAK_MAINTAINER} \
vendor=${KEYCLOAK_VENDOR} \
version=${KEYCLOAK_VERSION} \
url=${KEYCLOAK_URL} \
io.openshift.tags=${KEYCLOAK_TAGS} \
release="" \
vcs-ref="" \
com.redhat.build-host="" \
com.redhat.component="" \
com.redhat.license_terms=""
# server specific
ARG KEYCLOAK_SERVER_DISPLAY_NAME="Keycloak Server"
ARG KEYCLOAK_SERVER_IMAGE_NAME="keycloak"
ARG KEYCLOAK_SERVER_DESCRIPTION="${KEYCLOAK_SERVER_DISPLAY_NAME} Image"
LABEL name=${KEYCLOAK_SERVER_IMAGE_NAME} \
description=${KEYCLOAK_SERVER_DESCRIPTION} \
summary=${KEYCLOAK_SERVER_DESCRIPTION} \
io.k8s.display-name=${KEYCLOAK_SERVER_DISPLAY_NAME} \
io.k8s.description=${KEYCLOAK_SERVER_DESCRIPTION}
# oci
ARG KEYCLOAK_SOURCE="https://github.com/keycloak/keycloak"
ARG KEYCLOAK_DOCS=${KEYCLOAK_URL}documentation
LABEL org.opencontainers.image.title=${KEYCLOAK_SERVER_DISPLAY_NAME} \
org.opencontainers.image.url=${KEYCLOAK_URL} \
org.opencontainers.image.source=${KEYCLOAK_SOURCE} \
org.opencontainers.image.description=${KEYCLOAK_DESCRIPTION} \
org.opencontainers.image.documentation=${KEYCLOAK_DOCS}
Также, получаю ошибку путей:
> [keycloak ubi-micro-build 6/11] ADD keycloak-24.0.tar.gz /tmp/keycloak/:
------
------
> [keycloak ubi-micro-build 10/11] ADD ubi-null.sh /tmp/:
------
failed to solve: failed to compute cache key: failed to calculate checksum of ref 266965c1-1a96-46a6-b526-f8c2b1f612ee::ty43nz3ypmfpoozquw476gtkc: "/ubi-null.sh": not found
Может, есть у кого рабочий образ или Dockerfile для последних версий keycloak с обходом проблемы несовместимого оборудования?