I have two containers that I need to link together, one is a Tomcat application and another is the engine that it needs to connect to.
I can link both containers successfully and I have verified that there is no connectivity issues between both. However, one of the configuration files on the Tomcat container doesn’t seem to be able to resolve the hostname of the engine container, although ping of the hostname works fine. So I need to change the hostname to the IP of the engine container each time.
I don’t know if this is possible but I’m trying to find a way to automatically modify this configuration file on the Tomcat container with the IP address of the engine when I run the container. Is this possible?
I was thinking of putting a script inside the container with an sed command that would replace it either automatically or based on some value / parameter that is sent with the docker run command.
Any advise would be much appreciated. I’m new to Docker so please forgive me if this has been asked before, I couldn’t find anything matching what I wanted to do, maybe because I searched for the wrong terms.