title: Docker Container port issue: Not able to access tomcat url using host ip
body: <p>I am new to Docker, I have setup Docker Container on an <strong>Amazon Linux box</strong>.
  I have a docker file which installs <strong>tomcat java</strong> and a war.
  I can see all the installations present in the docker container when I navigate through the container in the exact folders I have mentioned in the Docker file.
  When I run the Docker container it says <strong>tomcat server</strong> has started and I have also tailed the logs so I can see the service is running.</p>
  
  <p>But when I open the host IP URL and <strong>8080 port</strong> it says URL can't be reached.</p>
  
  <p>These are the commands to build and run the file which works fine and I can see the status as running.</p>
  
  <pre><code>docker build -t friendly1 .             
  docker run  -p 8080:8080 friendly1  
  </code></pre>
  
  <p>What am I missing here? Request some help on this.</p>
  
  <pre><code> FROM centos:latest
   RUN yum -y update &amp;&amp; \
   yum -y install wget &amp;&amp; \
   yum -y install tar &amp;&amp; \
   yum -y install zip unzip
  
  
  ENV JAVA_HOME /opt/java/jdk1.7.0_67/
  ENV CATALINA_HOME /opt/tomcat/apache-tomcat-7.0.70
  ENV SAVIYNT_HOME /opt/tomcat/apache-tomcat-7.0.70/webapps
  ENV PATH $PATH:$JAVA_HOME/jre/jdk1.7.0_67/bin:$CATALINA_HOME/bin:$CATALINA_HOME/scripts:$CATALINA_HOME/apache-tomcat-7.0.70/bin
  
  ENV JAVA_VERSION 7u67
  ENV JAVA_BUILD 7u67
  
  
  RUN mkdir /opt/java/
  RUN wget https://&lt;S3location&gt;/jdk-7u67-linux-x64.gz &amp;&amp; \
   tar -xvf jdk-7u67-linux-x64.gz &amp;&amp; \
   #rm jdk*.gz &amp;&amp; \
   mv jdk* /opt/java/
  
  
  # Install Tomcat
  ENV TOMCAT_MAJOR 7
  ENV TOMCAT_VERSION 7.0.70
  
  RUN mkdir /opt/tomcat/
  RUN wget https://&lt;s3location&gt;/apache-tomcat-7.0.70.tar.gz  &amp;&amp; \
   tar -xvf apache-tomcat-${TOMCAT_VERSION}.tar.gz &amp;&amp; \
   #rm apache-tomcat*.tar.gz &amp;&amp; \
   mv apache-tomcat* /opt/tomcat/
  
  RUN chmod +x ${CATALINA_HOME}/bin/*sh
  
  WORKDIR /opt/tomcat/apache-tomcat-7.0.70/
  
  CMD "startup.sh"  &amp;&amp; tail -f /opt/tomcat/apache-tomcat-7.0.70/logs/*
  EXPOSE 8080
  </code></pre>