Skip to content

Commit

Permalink
KEYCLOAK-14495 Introduce support for JAVA_OPTS_APPEND
Browse files Browse the repository at this point in the history
  • Loading branch information
radudd authored and slaskawi committed Aug 26, 2020
1 parent 8f13aa9 commit f026a56
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,17 @@ Or you can volume the entire directory to supply a directory of scripts.
Note that when combining the approach of extending the image and `volume`ing the entire directory, the volume will override
all scripts shipped in the image.

## Start a Keycloak instance with custom command-line options

Additional server startup options (extension of JAVA_OPTS) can be configured using the `JAVA_OPTS_APPEND` environment variable. An use-case for this is to enable extra [profile features](https://www.keycloak.org/docs/latest/server_installation/#profiles).

### Example

Enable _upload_script_ profile:

docker run -e JAVA_OPTS_APPEND="-Dkeycloak.profile.feature.upload_script=enabled" jboss/keycloak


## Clustering

Replacing the default discovery protocols (`PING` for the UDP stack and `MPING` for the TCP one) can be achieved by defining
Expand Down
3 changes: 3 additions & 0 deletions server/tools/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ if echo "$@" | grep -E -v -- '-c |-c=|--server-config |--server-config='; then
SYS_PROPS+=" -c=standalone-ha.xml"
fi

# Adding support for JAVA_OPTS_APPEND
sed -i '$a\\n# Append to JAVA_OPTS. Necessary to prevent some values being omitted if JAVA_OPTS is defined directly\nJAVA_OPTS=\"\$JAVA_OPTS \$JAVA_OPTS_APPEND\"' /opt/jboss/keycloak/bin/standalone.conf

############
# DB setup #
############
Expand Down

0 comments on commit f026a56

Please sign in to comment.