This is where docker excels .
No, you do not really want to create one image. You want to use some already existing. The underlying OS is not really that important at this point but there are CentOS based images.
Your Docker Stack (https://docs.docker.com/get-started/part5/) consists of these images:
An example docker-compose.yml file would then look like this:
Walkthrough from the top.
db: is the label and the name of the service running Mysql. It is also the hostname that you should use in your connection string. Here I use the latest gratest. That is the image:
MySQL needs a password or it will generate it. You can pass it as an enrionment variable.
adminer: is a gui for working with databases. I expose that on port 8088.
web: is our webserver. Using the tomcat with the correct JRE installed.
I expose it to the system on port 8080.
volumes: mounts files and directories from my host system into Docker. I used maven to build my DockerExample.war so it is in the target directory of my project.
Put the docker-compose.yml file in the root of the project and run the command
to get it to run.
That would get you started.