I was running keycloak in docker all day yesterday at the office using these commands:
docker network create keycloak-network
docker run --name mysql -d --net keycloak-network -e MYSQL_DATABASE=keycloak -e MYSQL_USER=keycloak -e MYSQL_PASSWORD=password -e MYSQL_ROOT_PASSWORD=root_password mysql
docker run -d -it -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin --name keycloak --net keycloak-network -p 8080:8080 jboss/keycloak
When I got home the keycloak started failing with
/opt/jboss/tools/docker-entrypoint.sh: line 165: DB_ADDR: unbound variable
I added the DB_ADDR env var
docker run -e DB_ADDR=mysql -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin --name keycloak --net keycloak-network -p 8080:8080 jboss/keycloak:11.0.3
and it fails with
javax.resource.ResourceException: IJ031084: Unable to create connection
I’ve tried rolling back to 11.0.3 (version 12 was released yesterday) and tried adding
but still get the same error.
The only thing I can think of that changed was moving from my work network to my home network, but I can’t understand why that would be a problem when mysql and keycloak both run on the same docker network.
Is anyone else seeing this?