title: Cannot reach Spark Web UI located inside a Docker container
body: <p>I have a remote Virtual Machine and I'm developing a Spark Application that runs inside a Docker container.</p>
  
  <pre><code>2018-12-16 13:07:10 INFO  main [AbstractConnector] - Started ServerConnector@79c3f01f{HTTP/1.1,[http/1.1]}{0.0.0.0:4040}
  2018-12-16 13:07:10 INFO  main [Utils] - Successfully started service 'SparkUI' on port 4040.
  ...
  2018-12-16 13:07:10 INFO  main [SparkUI] - Bound SparkUI to 0.0.0.0, and started at http://f58300e7e6ea:4040
  </code></pre>
  
  <p>The log says that it launched SparkUI correctly, but binded to the container's localhost. At this point i decided to <code>EXPOSE</code> port 4040 during the building phase and to publish it during <code>run</code> with <code>-p 4040:4040/tcp</code> binding the two ports.</p>
  
  <p>When i try to reach <code>&lt;remote host name&gt;:4040</code> from my local machine (in Firefox) i can't connect to SparkUI. I also tried to telnet it but nothing.</p>
  
  <p>When i start the container i can see the 4040 port listeining using <code>netstat</code> but maybe it is not reachable from remote. How can i manage to do this?</p>
  
  <p>Basically I want to reach SparkUI from my Home PC --> Remote VM --> (Docker Container with Spark UI) using my browser.</p>
  
  <p>The Remote VM runs RHEL 7.   </p>