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:


  • How to make a docker container directory accesible from host?
  • How do I point a docker image to my .m2 directory for running maven in docker on a mac?
  • Certificate exceptions when running Scala SBT on Docker Alpine Linux container
  • Simple Continuous Deliver procedure for docker in aws
  • `docker rmi` tries to delete image with empty string (that does not exist)
  • Should I dockerize different servers running on a single machine?
  • <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 integrate spark cluster with other Hadoop2.x cluster on Docker
  • Modify NODE_ENV accordingly
  • Selenium Hub Node with Docker containers on different hosts
  • Building a docker image using AWS Developer Tools
  • Why isn't docker commit saving data in my mongo database container?
  • How can I tell if I'm logged in to a private Docker registry from a script?
  • 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.