Build a single image based on docker compose containers

This is not recommended at all. You will need to reverse engineer each image and copy the needed binaries/files into the combined image. The approach for that is to use docker multistage build:

FROM apexits/ubuntu-oracle-jdk8-tomcat9 as tomcat

FROM mysql:5.6.36 as mysql

FROM elasticsearch:2.3.4
COPY --from=tomcat /.../tomcat-installtion .../tomcat-installation
COPY --from=mysql /.../mysql-installtion .../mysql-installation
...

This approach is very trick and you need to reverse engineer each image to figure out which files/folder/config need to be copied onto the combined image…

Alternatively, you can start from one of the images and install the other programs using standard installation guidelines for each.

Even if you are successful with that, you will need to start multiple processes in same container which is not recommended and will introduce many complexities.

Leave a Comment