If I have correctly understood the use and purpose of docker, every process should be inside it's own container, thus not interfering with other running processes.
So based on that, I would like to run an Asterisk PBX server in one container, mysql database in other container and in the third container I would like to run the FreePBX GUI for Asterisk.
Running each of those services in it's own container is not a problem, but how would I connect those three together afterwards as I need the mysql db to log calls using CDR variables and the FreePBX should be installed to provide the GUI experience the for Asterisk configuration.
Any advice is appreciated, Thanks.
You should definitely give a try to docker-compose. This tool will help you to expose one container to other in easy way.
Your example with docker-compose.yml could look like this:
This will create 3 containers, first for DB, second for asterisk itself, third for freepbx. Asterisk and freepbx image will be able to connect to database host. Also freepbx will have access to volumes, which is published inside asterisk, for example, logs to parse, or config files.