Example Dockerfile with Keycloak server.
To boot in standalone mode
docker run jboss/keycloak
By default there is no admin user created so you won't be able to login to the admin console. To create an admin account you need to use environment variables to pass in an initial username and password. This is done by running:
docker run -e KEYCLOAK_USER=<USERNAME> -e KEYCLOAK_PASSWORD=<PASSWORD> jboss/keycloak
You can also create an account on an already running container by running:
docker exec <CONTAINER> keycloak/bin/add-user-keycloak.sh -u <USERNAME> -p <PASSWORD>
Then restarting the container:
docker restart <CONTAINER>
When starting the Keycloak instance you can pass a number an environment variables to set log level for Keycloak, for example:
docker run -e KEYCLOAK_LOGLEVEL=DEBUG jboss/keycloak
This image extends the jboss/base-jdk
image which adds the OpenJDK distribution on top of the jboss/base
image. Please refer to the README.md for selected images for more info.