Docker Community Forums

Share and learn in the Docker community.

Tomcat Configuration


I am new to Docker, can anyone let me know how a tomcat Docker container can refer to a webapp that is in another Docker container. Tomcat will use context roots to point to the webapp in the other container. In other words, I do not want to deploy the webapp directly inside tomcat, I would like to use context roots/aliases to point to a path where the webapp is, which is another Docker container.

containers don’t typically EXPORT volumes… they IMPORT them from the docker host.

now, you CAN have a host folder (volume) mapped onto a container volume (path) and not have the data INSIDE the container at build time.

Thank you for your input. Our product is basically a java webapp and a web server application deployed on any app server and web server. the product is about 1 GB and can reside anywhere on disk. Then the webserver and app server can point to the files on disk using aliases and context roots.

I would like to create a Docker container for our product and a separate Dcoker container for tomcat (which can act as both web server and app server).

Then I would like to distribute both docker containers. Can this be done?

yes,… i forgot about the docker run --volumes-from parm

here is a post with an example

Thank you, I will give it a try.

Thank you for your advice!