I just had this problem. And it happened in
Using normally Keycloak 17.0.1 and executing kc.sh build as follows:
I have a base Docker image like:
ARG BASE_IMAGE=arm64v8/openjdk:11
FROM $BASE_IMAGE AS build
ADD ./getting-started/keycloak-17.0.1.zip /
RUN unzip /keycloak-17.0.1.zip
...
ENV KEYCLOAK_HOME="/keycloak-17.0.1"
ENV KEYCLOAK_ADMIN="<redacted>"
ENV KEYCLOAK_ADMIN_PASSWORD="<redacted>"
ENV PATH="$PATH:$KEYCLOAK_HOME/bin"
ENV KC_HTTPS_CERTIFICATE_FILE=$KEYCLOAK_HOME/conf/key.pem
ENV KC_HTTPS_CERTIFICATE_KEY_FILE=$KEYCLOAK_HOME/conf/certificate.pem
RUN cd $KEYCLOAK_HOME/conf; \
SUBJECT="/C=<redacted>/ST=<redacted>/L=<redacted>/O=<redacted>/OU=<redacted>/CN=keycloak" && \
openssl req -newkey rsa:2048 -nodes -keyout $KC_HTTPS_CERTIFICATE_KEY_FILE -x509 -days 365 -out $KC_HTTPS_CERTIFICATE_FILE -subj "$SUBJECT"
...
then the script i use afterwards:
export KC_DB_USERNAME=${KC_DB_USERNAME:=<redacted>}
export KC_DB_PASSWORD=${KC_DB_PASSWORD:=<redacted>}
export KC_DB_SCHEMA=${KC_DB_SCHEMA:=keycloak}
export KC_DB_URL='jdbc:mysql://<redacted>/keycloak'
...
kc.sh build --db=mysql --features=authorization,account2,account-api,docker,impersonation,upload-scripts,web-authn,client-policies,ciba,par,preview && touch flag
It was working perfectly. But when I changed to 18.0.0 it failed the build activity
Reading the kc.sh build output, it seems that kc.sh is doing 2 things wrongly: ignoring --db=mysl; and failing in interpreting --features
like: kc.db = dev (PersistedConfigSource)
So I changed the image to
ADD ./getting-started/keycloak-18.0.0.zip /
RUN unzip /keycloak-18.0.0.zip
ENV KEYCLOAK_HOME="/keycloak-18.0.0"
and my script to (worked for both images: .ZIP downloaded and
quay.io based)
export KC_DB=mysql
export KC_FEATURES=authorization,account2,account-api,docker,impersonation,upload-scripts,web-authn,client-policies,ciba,par,preview
kc.sh build --db=mysql && touch flag
Now it is working correctly again.
I believe this release has a defect in kc.sh build. But I cannot affirm that because I didn't make a diff in both versions
Regards,