Docker OSX: Connect to a host port from a container
<h1>My problem</h1>

<p>I am trying to install a Flask app on a docker container. The app requires some packages to be installed via <a href="https://pip.pypa.io/en/stable/" rel="nofollow noreferrer">pip</a>.</p>

<p>I am using a local (host, not container) pip repo on port 9000. Therefore, I tried the following:</p>

<pre><code>pip install -i 127.0.0.1:9000/simple my_custom_package
</code></pre>

<p>This call works on the host, but when I run it on the container I get:</p>

<pre><code>Collecting my_custom_package
Url '127.0.0.1:9000/simple/my_custom_package/' is ignored. 
    It is either a non-existing path or lacks a specific scheme.
</code></pre>

<p>I made some attempts with <code>curl</code>, but it seems that the container can't simply access a port on the host machine.</p>

<h1>Settings</h1>

<ul>
<li>OSX 10.11.6</li>
<li>Docker version 1.12.1, build 6f9534c</li>
<li><a href="https://hub.docker.com/r/tiangolo/uwsgi-nginx-flask/" rel="nofollow noreferrer">tiangolo/uwsgi-nginx-flask</a> image</li>
</ul>

<h1>What have I tried</h1>

<ul>
<li>I have read <a href="https://stackoverflow.com/questions/31324981/how-to-access-host-port-from-docker-container">How to access host port from docker container</a>, but the solution does not work for OSX.</li>
<li><a href="https://forums.docker.com/t/access-host-not-vm-from-inside-container/11747/3" rel="nofollow noreferrer">Access host not vm from inside container</a>, but the data is outdated and the solutino does not work on my system.</li>
</ul>

<p><strong>How do I access host ports from a Docker container on OSX?</strong></p>