Docker – few containers

Who could explain how create and connect one to other docker containers.
I need info how connect one container with Nginx to second container with PostgreSQL. How make this relation?
First container with Nginx should get info from second container with Postgre.
I know how create container, how start service but i don’t know how create relation.

Thx!

  • How to get Docker working on a Surface Pro 4 laptop with Windows 10
  • Run app inside docker container as non-root user with capabilities
  • cannot ssh Docker Provided Container with Vagrant. Vagrant ssh doesnt work too
  • Configure Marathon-LB from docker-compose
  • error : curl: (52) Empty reply from server , when ingesting data into druid
  • docker data volume vs mounted host directory
  • Error checking context is accessible: 'can't stat '.gvfs''. Please check permissions and try again
  • How to change the dns of a running docker container
  • How to create a docker machine without TLS to use in Mac Env with Java
  • Debian Host: CTRL + P + Q doesn't keep container alive
  • How can I connect to JMX through Kubernetes managed Docker containers?
  • How could I connect to nginx vhost in Docker container from linked php Docker container?
  • One Solution collect form web for “Docker – few containers”

    There are a number of ways, usually involving an external script or other such system to collect information (such as port mappings) from one container, by parsing the json info or getting the port mappings, and passing that into a new container that would use it to connect to the first. There are examples of that in the documentation and examples section.

    With v0.6.5, released 2013-10-31, Docker is adding the ability to coordinate some of this within itself. For now (2013-11-01), the blog post has most of the information on how to use it, but keep you eye on the documention for more.

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