O'Reilly logo

Orchestrating Docker by Shrikrishna Holla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Linking containers

Binding container ports to host ports is all okay if you just have a plain web server that you want to expose to the Internet. Most production systems, however, are made of lots of individual components that are constantly communicating with each other. Components such as the database servers must not be bound to publicly visible IPs, but the containers running the frontend applications still need to discover the database containers and connect to them. Hardcoding a container's IP addresses in the application is neither a clean solution nor will it work because IP addresses are randomly assigned to the containers. So how do we solve this problem? The answer is as follows.

Linking containers within the same host

A link can be

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required