Im am using docker compose to run 2 containers (both centos based). This is my yml:
front:
build: front/docker/java
ports:
- "8080:8080"
links:
- back:db
back:
build: back/docker/java
ports:
- "8081:8081"
But the front container gets nothing in the /etc/hosts for or env vars to be able to connect to the back container. I am running docker 1.3.2.
/etc/hostsin the container. You should be getting a handful of environment variables likeDB_PORT,DB_PORT_8081_TCP, etc as described in the docs. My guess is you might not be checking for the correct environment variable names or you might not be accessing environment variables correctly in your program. Could you post exactly how you are determining that you "get nothing"?runinstead ofexecto list the env vars