Running Keycloak 19.0.1 on docker.
save the following to a YML file
version: '3.8'services:then start the docker.
keycloak:
image: quay.io/keycloak/keycloak:19.0.1
command:
[
'-b',
'0.0.0.0',
'-Dkeycloak.migration.action=import',
'-Dkeycloak.migration.provider=dir',
'-Dkeycloak.migration.dir=/opt/jboss/keycloak/realm-config',
'-Dkeycloak.migration.strategy=OVERWRITE_EXISTING',
'-Djboss.socket.binding.port-offset=1000',
]
volumes:
- ./realm-config:/opt/jboss/keycloak/realm-config
environment:
- KEYCLOAK_USER=admin
- KEYCLOAK_PASSWORD=admin
- DB_VENDOR=h2
- KEYCLOAK_IMPORT_REALM=/keycloak/import/realm-import.json
- KEYCLOAK_EXPORT_REALM=/keycloak/export/realm-import.json
ports:
- 9080:9080
- 9443:9443
- 10990:10990
It can be started from the command line, or from within by right clicking on the file and clicking run.
The output looks like this:
docker-compose -f /home/james/IdeaProjects/primeagile-api/primeagile-containers/keycloak.yml up -d
Creating network "primeagile-containers_default" with the default driver
Pulling keycloak (quay.io/keycloak/keycloak:19.0.1)...
19.0.1: Pulling from keycloak/keycloak
a96e4e55e78a: Pull complete
67d8ef478732: Pull complete
b475f6dd1f58: Pull complete
9e1fdef721a2: Pull complete
Digest: sha256:fb6be1665f2939ca123b5fee0d6d8e06a3d99ba1e5224b5b1cf0eb48168f1ef6
Status: Downloaded newer image for quay.io/keycloak/keycloak:19.0.1
Creating primeagile-containers_keycloak_1 ... done