Link Running External Docker to docker-compose services

I assume that there is a way to link via one or a combination of the following: links, external_links and networking.

Any ideas? I have come up empty handed so far.

  • How can I mount a volume among remote Docker Machines?
  • Unable to connect Vagrant machine to bridged network
  • Using dockerfile ADD and COPY commands on Mac OS X
  • TCP receives packets, but it ignores them
  • Gitlab Mocha tests and Docker Tag problems
  • Build container found dead before completing the build. Build container died because it was out of memory, or the Docker image was missing glibc
  • Here is an example snippet of a Docker-compose which is started from within a separate Ubuntu docker

    version: '2'
     services:
      web:
       build: .
       depends_on:
        - redis
     redis:
      image: redis
    

    I want to be able to connect to the redis port from the Docker that launched the docker-compose.

    I do not want to bind the ports on the host as it means I won’t be able to start multiple docker-compose from the same model.

    — context —
    I am attempting to run a docker-compose from within a Jenkins maven build Docker so that I can run tests. But I cannot for the life of me get the original Docker to access exposed ports on the docker-compose

  • What is the significance of the user in `/etc/sub{u,g}id`? (Help me grok user namespaces)
  • Can't get an interactive Docker shell inside screen
  • How to initialize and run Docker on windows?
  • Do I always need to rebuild docker in order to install new pip packages?
  • Docker Selenium-Chrome container memory utilization
  • Changing permissions of added file to a Docker volume
  • One Solution collect form web for “Link Running External Docker to docker-compose services”

    Reference the machines by hostname, v2 automatically connects the nodes by hostname on a private network by default. You’ll be able to ping “web” and “redis” from within each container. If you want to access the machines from your host, include a “ports” definition for each service in your yml.

    The v1 links were removed from the v2 compose syntax since they are now implicit. From the docker compose file documentation

    links with environment variables: As documented in the environment variables reference, environment variables created by links have been
    deprecated for some time. In the new Docker network system, they have
    been removed. You should either connect directly to the appropriate
    hostname or set the relevant environment variable yourself…

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.