Question

I have two Docker Containers. How can can Container A communicate with Container B over TCP?

In my scenario: Container A runs Apache. Container B runs PHP-FPM. Apache needs to talk to PHP-FPM.

Was it helpful?

Solution

I just answered that this morning :-)

Link to the answer (it talks about php-fpm and nginx, but the concept is the same for apache of course): https://stackoverflow.com/a/19997381/227887

Long story short, you want to use container linking, a new feature as of 0.6.5 that permits to expose a port from a container to another.

See also the official docker documentation : http://docs.docker.io/en/latest/examples/linking_into_redis/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top