G
G
George N2016-08-29 09:36:35
Docker
George N, 2016-08-29 09:36:35

How to properly cross docker containers?

I can't figure out how to link together two apache and php docker containers - this one and this one .
Those. the option is clear when apache and php are in the same container, but to make these two work together?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Tyranron, 2016-08-31
@Tyranron

It all depends on the interaction model between apache and php that you require.
Roughly speaking: how many processes - so many containers.
If you look closely at the versions of the php images, you can see that they provide different tools (look at CMDin Dockerfile). So, for example, 7.0-fpman image is a php-fpmdaemon process. But this 7.0-cliis just launching the php interpreter in interactive mode ( php -a). The version 7.0-apacheis generally an Apache server that can run php scripts.
Accordingly, if you need an Apache + php-fpm model, then we take a container apacheand knit it with a php:fpm. If you need Apache to run php scripts directly, take one php:apache.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question