I am trying to understand Docker. The idea is that we can create a complete environment and have it run on any machine. But in my mind there is a problem.
Imagine that I create a Apache/PHP/MySQL application where Apache/PHP is on 1) one container and MySQL is 2) another container. Then my friend says - “Hey mate, I just created this really cool Apache/PHP/PostgreSQL application, can I run it on your server?”. But he also has a Apache/PHP (different configuration) container and a PostgreSQL container. He DID NOT KNOW that there is already a Apache/PHP container running on the server. That means we will have 2 Apache and PHP installations running on the server.
If we were not using Docker we could use the same Apache and PHP. Except we would need to install some Postgres extensions. Is my understanding correct? Is this how it is done?