Docker Community Forums

Share and learn in the Docker community.

Accessing container's IP in docker compose "command"


(Ahaddad) #1

Hi,

I would like to use the IP address of a container in the “command” of docker compose. I tried to use the name of the image but it does not work. E.g.

version: '2'
services:

   cassandra:
    image: cassandra

    web:
      build: .
      links:
       - cassandra
      command: echo cassandra