Closed lucamoroldo closed 11 months ago
Hi @lucamoroldo, could you check if host.docker.internal
can be resolved to an IP address in your WSL2 environment?
$ host host.docker.internal
host.docker.internal has address 127.0.0.1
That hostname should be configured automatically when installing Docker Desktop. And it should result in the following configuration in the /etc/hosts
file within your WSL2 environment.
127.0.0.1 host.docker.internal
If it's not there, could you try adding that manually (vim /etc/hosts
) and then try again running Edge Service?
Since there hasn't been any activity in the past few months, I'm closing this issue, but feel free to open a new one should you still have some issues about the network setup. Thanks!
@lucamoroldo Have you solved that problem? I met the same problem too. Anyone could help me?
docker engine
(not docker desktop
) version: 24.0.7
host.docker.internal
to /etc/hosts
. Your /etc/hosts
file on your host machine should looks like this:
127.0.0.1 localhost host.docker.internal
rather than this:
127.0.0.1 localhost
127.0.0.1 host.docker.internal
host.docker.internal
to no_proxy
and NO_PROXY
environment varaible (~/.bashrc
or ~/.zshrc
on host machine).
host.docker.internal
to proxy Exceptions
in your host Chrome
browser. It should look like host.docker.internal,*.yahoo.com
docker-compose.yml
file should look like this (Note the addition of host.docker.internal:host-gateway in the extra_hosts
section for both catalog_service
and edge-service
):
version: '3.8'
services:
catalog-service:
depends_on:
- fluent-bit
- polar-keycloak
- polar-postgres
- tempo
image: catalog-service
container_name: catalog-service
ports:
- '9001:9001'
- '8001:8001'
environment:
- BPL_JVM_THREAD_COUNT=50
- BPL_DEBUG_ENABLED=true
- BPL_DEBUG_PORT=8001
- >-
JAVA_TOOL_OPTIONS=-javaagent:/workspace/BOOT-INF/lib/opentelemetry-javaagent-1.32.0.jar
- OTEL_SERVICE_NAME=catalog-service
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://tempo:4317'
- OTEL_METRICS_EXPORTER=none
- 'SPRING_CLOUD_CONFIG_URI=http://config-service:8888'
- >-
SPRING_DATASOURCE_URL=jdbc:postgresql://polar-postgres:5432/polardb_catalog
- SPRING_PROFILES_ACTIVE=testdata
- >-
SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER_URI=http://host.docker.internal:8080/realms/PolarBookshop
extra_hosts:
- 'host.docker.internal:host-gateway'
logging:
driver: fluentd
options:
fluentd-address: '127.0.0.1:24224'
edge-service:
depends_on:
- fluent-bit
- polar-keycloak
- polar-redis
- polar-ui
- tempo
image: edge-service
container_name: edge-service
ports:
- '9000:9000'
- '8000:8000'
environment:
- BPL_DEBUG_ENABLED=true
- BPL_DEBUG_PORT=8000
- 'CATALOG_SERVICE_URL=http://catalog-service:9001'
- >-
JAVA_TOOL_OPTIONS=-javaagent:/workspace/BOOT-INF/lib/opentelemetry-javaagent-1.32.0.jar
- OTEL_SERVICE_NAME=edge-service
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://tempo:4317'
- OTEL_METRICS_EXPORTER=none
- 'ORDER_SERVICE_URL=http://order-service:9002'
- 'SPA_URL=http://polar-ui:9004'
- 'SPRING_CLOUD_CONFIG_URI=http://config-service:8888'
- SPRING_REDIS_HOST=polar-redis
- >-
SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_KEYCLOAK_ISSUER_URI=http://host.docker.internal:8080/realms/PolarBookshop
extra_hosts:
- 'host.docker.internal:host-gateway'
logging:
driver: fluentd
options:
fluentd-address: '127.0.0.1:24224'
polar-keycloak:
image: 'quay.io/keycloak/keycloak:23.0'
container_name: polar-keycloak
command: start-dev --import-realm
volumes:
- './keycloak:/opt/keycloak/data/import'
environment:
- KEYCLOAK_ADMIN=user
- KEYCLOAK_ADMIN_PASSWORD=password
ports:
- '8080:8080'
SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_KEYCLOAK_ISSUER_URI=http://host.docker.internal:8080/realms/PolarBookshop
is passed from the back-end
Spring Boot application to the front-end
. This will prompt the browser to redirect to http://host.docker.internal:8080/realms/PolarBookshop
when you click the login
button on the webpage. Is it right?
Hi, I wanted to test the tracing functionality by calling the edge-service /books endpoint. However, when running the edge-service (docker-compose up edge-service), the service startup fails with the logs attached. It seems that it cannot resolve "host.docker.internal". I'm running the services on WSL (Windows 11).
Note that all the other dependencies are running (grafana, keycloak, etc) and by running "http :8080/realms/PolarBookshop" I get a valid response containing the public key.
Edge service logs: