Reputation: 133
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
......
Upvotes: 4
Views: 59
Reputation: 2536
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
Upvotes: 1
Reputation: 21
the service you are looking for is kubernetes and called pod and/or deployment.
You can put nginx/php in two separate container into the same pod and the mysql-server in another pod.
Upvotes: 0