Docker Community Forums

Share and learn in the Docker community.

Running a tomcat instance on Azure Cloud using Docer

docker

(Manmedia) #1

localhost should be up when navigated to from browser

times out

Ran the following command:

docker run -it -p 8088:8080 --rm tomcat:8.5

And received the following:
18-Feb-2018 10:50:01.798 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.5.28
18-Feb-2018 10:50:01.801 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Feb 6 2018 23:10:25 UTC
18-Feb-2018 10:50:01.802 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.5.28.0
18-Feb-2018 10:50:01.802 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
18-Feb-2018 10:50:01.803 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.13.0-1007-azure
18-Feb-2018 10:50:01.803 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
18-Feb-2018 10:50:01.803 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-8-openjdk-amd64/jre
18-Feb-2018 10:50:01.804 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_151-8u151-b12-1~deb9u1-b12
18-Feb-2018 10:50:01.805 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
18-Feb-2018 10:50:01.805 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/local/tomcat
18-Feb-2018 10:50:01.806 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/local/tomcat
18-Feb-2018 10:50:01.806 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
18-Feb-2018 10:50:01.807 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
18-Feb-2018 10:50:01.807 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
18-Feb-2018 10:50:01.808 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
18-Feb-2018 10:50:01.809 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
18-Feb-2018 10:50:01.809 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
18-Feb-2018 10:50:01.810 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
18-Feb-2018 10:50:01.810 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
18-Feb-2018 10:50:01.812 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.16] using APR version [1.5.2].
18-Feb-2018 10:50:01.812 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
18-Feb-2018 10:50:01.812 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
18-Feb-2018 10:50:01.817 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.0f 25 May 2017]
18-Feb-2018 10:50:01.909 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler [“http-nio-8080”]
18-Feb-2018 10:50:01.921 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
18-Feb-2018 10:50:01.927 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler [“ajp-nio-8009”]
18-Feb-2018 10:50:01.928 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
18-Feb-2018 10:50:01.929 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 593 ms
18-Feb-2018 10:50:01.948 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
18-Feb-2018 10:50:01.949 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.28
18-Feb-2018 10:50:01.957 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/docs]
18-Feb-2018 10:50:02.297 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/docs] has finished in [340] ms
18-Feb-2018 10:50:02.298 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/examples]
18-Feb-2018 10:50:02.569 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/examples] has finished in [271] ms
18-Feb-2018 10:50:02.570 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/manager]
18-Feb-2018 10:50:02.611 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/manager] has finished in [41] ms
18-Feb-2018 10:50:02.612 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/ROOT]
18-Feb-2018 10:50:02.640 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/ROOT] has finished in [27] ms
18-Feb-2018 10:50:02.640 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/host-manager]
18-Feb-2018 10:50:02.668 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/host-manager] has finished in [28] ms
18-Feb-2018 10:50:02.671 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [“http-nio-8080”]
18-Feb-2018 10:50:02.684 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [“ajp-nio-8009”]
18-Feb-2018 10:50:02.687 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 757 ms

But when I used my container’s dns name and port number from an external browser, I received timeout error:

http://mydockerapp.centralus.cloudapp.azure.com:8080/

Steps to reproduce the behavior

  1. Installed docker
  2. Ran “docker run -it -p 8088:8080 --rm tomcat:8.5” comman

(Manmedia) #2

Solved my problem.
I was running it on a Linux VM and that server needed port 8080 to be whitelisted for incoming HTTP requests for TCP port 8080. Allowed that and it worked next time.

Thanks