Add new Tomcat containers behind Apache with Docker

I have a Java web app running on Tomcat behind Apache. I want to launch a new Tomcat container for each new customer, but all of them behind the same Apache. Each client has its own subdomain, and Apache proxies them to the right Tomcat instance. Here is an example of my Apache configuration for one customer:


  • Can't connect to docker published port for tftp
  • Bind-mount volume of different type from guest to host
  • Container Based Application Clustering System
  • Issue with assigning static IP to docker container using Terraform
  • Pass parameters to docker container using docker run command
  • sudo docker build -t=“nisevi/static_web” is not working
  • <VirtualHost *:80>
        ProxyPass / ajp://tomcat1:8009/
        ProxyPassReverse / ajp://tomcat1:8009/

    Then I start the Apache container with --link tomcat1 and everything works just fine.

    What I’m trying to figure out how to do is to add new Tomcat containers dynamically after the Apache container is already running and have Apache to reference them correctly.

    The issue is that even adding sites-enabled/app2.conf to the Apache container dynamically, it doesn’t work because when the Apache container didn’t have a --link tomcat2 when it was launched, hence it doesn’t know how to reach the new Tomcat container.

    Do you guys have any ideas of how I can get this to work other than stopping the Apache container and relaunching it with the --link tomcat2 argument?

  • How to use GC in Docker Registry without accessing container
  • Best way to distribute a docker container to people with varying technical backgrounds [closed]
  • Run sonarqube scanner with gitlab ci
  • Can't figure out how I have to build my Docker architecture
  • Dockerfile HOSTNAME Instruction for docker build like docker run -h
  • Error response from daemon: 400 Bad Request: malformed Host header
  • One Solution collect form web for “Add new Tomcat containers behind Apache with Docker”

    Links are considered legacy and have been replaced with networks. Join apache and all tomcat containers into the same bridge network to achieve direct connectivity between them, then you can create and remove tomcat containers at will.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.