title: Docker Image Not Loading on Localhost. Network, etc
body: <p>I have been having really hard time figuring out the problem with my docker image not loading on localhost. I am using Docker for Windows 7. Following is some information regarding my docker image, network, etc, if it can be any helpful in proposing solutions.</p>
  
  <p>I have <code>EXPOSE 80</code> in my docker file. and <code>listen 8080</code> in my shinyserver.conf file. I run my image by typing <code>docker run -p 80:8080 imagename</code>. It goes back to command line. Then I check <a href="http://localhost" rel="nofollow noreferrer">http://localhost</a> or <a href="http://localhost:8080" rel="nofollow noreferrer">http://localhost:8080</a>, or <a href="http://172.17.0.1" rel="nofollow noreferrer">http://172.17.0.1</a> or <a href="http://172.17.0.1:8080" rel="nofollow noreferrer">http://172.17.0.1:8080</a> or <a href="http://192.168.99.100" rel="nofollow noreferrer">http://192.168.99.100</a> and no image shows up. </p>
  
  <p>When I run <code>docker ps</code> there is no running container (makes sense, since image is not running anyway on localhost). All exited containers show with <code>docker ps -a</code>. There some containers that I haven't even created by show (i guess it comes with creating images). </p>
  
  <p>I run docker inspect to find the IP address and here is what I get (there is no IP on fitfarmz which is my imagename)</p>
  
  <pre><code>$ docker inspect -f '{{.Name}} - {{.NetworkSettings.IPAddress }}' $(docker ps -aq)
  
  /mystifying_johnson -
  /wonderful_newton -
  /flamboyant_brown -
  /gallant_austin -
  /fitfarmz-2 -
  /fitfarmz -
  /amazing_easley -
  /nervous_lewin -
  /silly_wiles -
  /lucid_hopper -
  /quizzical_kirch -
  /boring_gates -
  /clever_booth -
  /determined_mestorf -
  /pedantic_wozniak -
  /goofy_goldstine -
  /sharp_ardinghelli -
  /xenodochial_lamport -
  /keen_panini -
  /blissful_lamarr -
  /suspicious_boyd -
  /confident_hodgkin -
  /vigorous_lewin - 172.17.0.2
  /quirky_khorana -
  /agitated_knuth -
  </code></pre>
  
  <p>I also got info on docker network:</p>
  
  <pre><code>$ docker network inspect bridge
  [
      {
          "Name": "bridge",
          "Id": "9105bd8d679ad2e7d814781b4fa99f375cff3a99a047e70ef63e463c35c5ae28"
  ,
          "Created": "2018-09-08T22:22:51.075519268Z",
          "Scope": "local",
          "Driver": "bridge",
          "EnableIPv6": false,
          "IPAM": {
              "Driver": "default",
              "Options": null,
              "Config": [
                  {
                      "Subnet": "172.17.0.0/16",
                      "Gateway": "172.17.0.1"
                  }
              ]
          },
          "Internal": false,
          "Attachable": false,
          "Ingress": false,
          "ConfigFrom": {
              "Network": ""
          },
          "ConfigOnly": false,
          "Containers": {},
          "Options": {
              "com.docker.network.bridge.default_bridge": "true",
              "com.docker.network.bridge.enable_icc": "true",
              "com.docker.network.bridge.enable_ip_masquerade": "true",
              "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
              "com.docker.network.bridge.name": "docker0",
              "com.docker.network.driver.mtu": "1500"
          },
          "Labels": {}
      }
  ]
  </code></pre>
  
  <p>Here is the dockerfile:</p>
  
  <pre><code>FROM r-base:3.5.0
  
  # Install Ubuntu packages
  RUN apt-get update &amp;&amp; apt-get install -y \
      sudo \
      gdebi-core \
      pandoc \
      pandoc-citeproc \
      libcurl4-gnutls-dev \
      libcairo2-dev/unstable \
      libxt-dev \
      libssl-dev 
  
  
  # Add shiny user
  RUN groupadd  shiny \
  &amp;&amp; useradd --gid shiny --shell /bin/bash --create-home shiny
  
  
  
  # Download and install ShinyServer
  RUN wget --no-verbose https://download3.rstudio.org/ubuntu-14.04/x86_64/shiny-server-1.5.7.907-amd64.deb &amp;&amp; \
      gdebi shiny-server-1.5.7.907-amd64.deb
  
  
  # Install R packages that are required
  RUN R -e "install.packages(c('Benchmarking', 'plotly', 'DT'), repos='http://cran.rstudio.com/')"
  RUN R -e "install.packages('shiny', repos='https://cloud.r-project.org/')"
  
  # Copy configuration files into the Docker image
  COPY shiny-server.conf  /etc/shiny-server/shiny-server.conf
  COPY /app /srv/shiny-server/
  
  # Make the ShinyApp available at port 80
  EXPOSE 80
  
  # Copy further configuration files into the Docker image
  COPY shiny-server.sh /usr/bin/shiny-server.sh
  
  CMD ["/usr/bin/shiny-server.sh"]
  </code></pre>
  
  <p>And shinyserver.conf:</p>
  
  <pre><code># Define the user we should use when spawning R Shiny processes
  run_as shiny;
  
  # Define a top-level server which will listen on a port
  server {
    # Instruct this server to listen on port 80. The app at dokku-alt need expose PORT 80, or 500 e etc. See the docs
    listen 8080;
  
    # Define the location available at the base URL
    location / {
  
      # Run this location in 'site_dir' mode, which hosts the entire directory
      # tree at '/srv/shiny-server'
      site_dir /srv/shiny-server;
  
      # Define where we should put the log files for this location
      log_dir /var/log/shiny-server;
  
      # Should we list the contents of a (non-Shiny-App) directory when the user 
      # visits the corresponding URL?
      directory_index on;
    }
  }
  </code></pre>
  
  <p>Here is the shiny-server.sh file:</p>
  
  <pre><code>mkdir -p /var/log/shiny-server
  chown shiny.shiny /var/log/shiny-server
  
  exec shiny-server &gt;&gt; /var/log/shiny-server.log 2&gt;&amp;1
  </code></pre>
  
  <p>Any ideas what is going wrong? I use the command: <code>docker run -p 80:8080 fitfarmz</code> to run the image.</p>