Skip to content
Advertisement

Docker multi serivces in a single container

is it a good practice to create one dockerfile with all needed container , ex :

1 - FROM ubutnu

2 - RUN apt install php7.4

3 - RUN apt install mysql-server

4 - RUN apt install nginx

5 - RUN apt install openssh-server
......

Advertisement

Answer

This is actually a bad idea. The principle of containers is one service per one container.

A container is really just a process. You might run 50 different containers on a machine, with very little overhead, and still gain the advantages of isolation for each service.

A good primer on the inherent differences between containers and VMs

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement