I am new to docker and having a simple DW(dropwizard) application that connects to elasticsearch, Which is already running in docker using the docker-compose.yml, which has
Two ways to solve this: First is to check what network docker-compose created for your elasticsearch setting (docker network ls
) and then run your DW app with
docker run --network=<name of network> ...
Second way is to create a network docker network create elastic
and use it as external network in your docker compose file as well as in your docker run command for the DW app.
Docker compose file could then look like
...
services:
elasticsearch:
networks:
elastic:
...
networks:
elastic:
external: true