Docker Community Forums

Share and learn in the Docker community.

Multiple Tomcats in Single Docker Image


(Test96) #1

Hi ,

i have to develop Single Docker image with multiple tomcat servers.Let me explain in brief

I have 4 spring mvc java modules each module gives respective project name *.war file
1.MA (Tomcat Port :9081)
2.GM (Tomcat Port :9090)
3.VG (Tomcat Port :9091)
4.DR (Tomcat Port :9092)

Now i took base image as Tomcat:8 (/usr/local/tomcat/webapps)
Now i have to develop above 4 modules with different tomcat server folders on top of base image

docker run -it -d -p 9081:8080 s33reqr343ef (imageID) (It is running on 9081) but my requirement is without specifying port number in above run command how to tomcat will run respective port and how to run all four diff tomcat server folders on same image

i have to push image with four diif tomcat servers to docker hub.when i pull and run that image should able to access all above modules with respective ports without specying them on run command