Skip to content

Commit 563a8a0

Browse files
Silence Keycloak build-time warnings
- Set `KC_DB=dev-file` explicitly before `kc.sh build` to replace the implicit default, which Keycloak 26 now warns about deprecating. `dev-file` preserves existing behavior; operators needing a real database override `KC_DB` at build time. - Move `KC_HTTP_ENABLED` and `KC_HOSTNAME_STRICT` to an `ENV` *after* `kc.sh build`. They are runtime options; having them in the build environment triggered a "will be ignored during build time" warning.
1 parent 602c24b commit 563a8a0

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

Dockerfile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,23 @@ COPY --from=spi-builder /build/target/webprotege-credential-check-authenticator-
1818
COPY ./webprotege.json /opt/keycloak/import/webprotege.json
1919
COPY --chmod=755 ./entrypoint.sh /opt/keycloak/bin/entrypoint.sh
2020

21+
# Build-time: explicitly set the db so `kc.sh build` does not warn about
22+
# relying on the deprecated default. `dev-file` is Keycloak's H2 file-backed
23+
# store — matches the previous implicit default. Operators who need a real
24+
# database override KC_DB at build time and rebuild the image.
25+
ENV KC_DB=dev-file
26+
RUN /opt/keycloak/bin/kc.sh build
27+
2128
# Runtime defaults so `kc.sh start` (production mode) works out of the box.
2229
# The image is intended to sit behind a reverse proxy that terminates TLS,
2330
# so plain HTTP is accepted inside the container. hostname-strict is
2431
# disabled because the public hostname varies by deployment; the entrypoint
25-
# patches the realm's frontend URL to match SERVER_HOST at runtime. Both
26-
# are runtime options — override at `docker run` time if needed.
32+
# patches the realm's frontend URL to match SERVER_HOST at runtime.
33+
#
34+
# These are runtime options, so they are set AFTER `kc.sh build` — otherwise
35+
# Keycloak prints a "will be ignored during build time" warning when build
36+
# sees them in the environment. Override either at `docker run` time.
2737
ENV KC_HTTP_ENABLED=true \
2838
KC_HOSTNAME_STRICT=false
2939

30-
RUN /opt/keycloak/bin/kc.sh build
31-
3240
ENTRYPOINT ["/opt/keycloak/bin/entrypoint.sh"]

0 commit comments

Comments
 (0)