network issue in one docker compose with keycloak and tomcat container -
greeting,
i'm beginner learning web authentication, , try tomcat , keycloak in docker compose. put them in 1 docker-compose.yml follows:
version: '2' services: postgres: image: postgres ports: - "5432:5432" environment: postgres_database: 'keycloak' postgres_user: 'keycloak' postgres_password: 'keycloak' postgres_root_password: 'test' volumes: - ./postgres:/mnt/shares/postgres keycloak: image: jboss/keycloak-postgres ports: - "800:8080" links: - postgres environment: postgres_port_5432_tcp_addr: 'postgres' postgres_database: 'keycloak' postgres_user: 'keycloak' postgres_password: 'keycloak' keycloak_user: 'admin' keycloak_password: 'admin' postgres_root_password: 'test' depends_on: - postgres volumes: - ./keycloak:/mnt/shares/keycloak tomcat_keycloak: build: . ports: - "880:8080" volumes: - ./web:/mnt/shares/web - ./scratches:/mnt/shares/scratches
this can launch fine. next created realm, client, , user in keycloak, obtained keycloak.json tomcat follows:
{ "realm": "testrealm", "auth-server-url": "http://192.168.208.130:800/auth", "ssl-required": "external", "resource": "test-client", "public-client": true, "use-resource-role-mappings": true } where 192.168.208.130 host ip address. tried static web link in tomcat server. redirected keycloak login page. after entering user name , password, got http status 403. in keycloak events saw logon successful, , session established. checked tomcat output, , found following:
07-apr-2017 17:37:04.240 info [http-apr-8080-exec-4] org.apache.http.impl.client.defaulthttpclient.tryconnect i/o exception (java.net.noroutetohostexception) caught when connecting {}->http://192.168.208.130:800: no route host (host unreachable)
looks tomcat container, cannot http client connection keycloak server container via url in host ip address. can ping host ip tomcat container though.
could me find out i'm missing in configuration? appreciate.
Comments
Post a Comment