title: unable to connect to local dockerized devpi container for pip install in another container without "--net=host"
body: <p>I am running devpi in a docker container like so:</p>
  
  <pre><code>[Unit]
  Description=devpi docker-container
  Requires=docker.service
  After=docker.service
  
  [Service]
  Restart=always
  RestartSec=3
  ExecStart=/usr/bin/docker run --rm -p 3141:3141 --name devpi -v /devpi_data:/data -e DEVPI_PASSWORD='********' akailash/docker-devpi
  ExecStop=/usr/bin/docker stop -t 2 devpi
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  
  <p>It runs fine. I can access it via URL on the host as well as install packages from it as expected. </p>
  
  <pre><code>6f663ba131a1        akailash/docker-devpi   "/docker-entrypoint.…"   3 hours ago         Up 3 hours          0.0.0.0:3141-&gt;3141/tcp   devpi
  </code></pre>
  
  <p>However, if I want to build another docker image installing packages from this container there is a ConnectTimeout. If I try a curl the connection times out after a while.</p>
  
  <p>I can do a pip install if I use --net=host option as described in this <a href="https://github.com/moby/moby/issues/13914" rel="nofollow noreferrer">issue</a> . However, I don't want to have to use host networking. I have tried 0.0.0.0:3141 as well as 172.17.0.1:3141 and I have the same results. Adding --ip=0.0.0.0 in the docker daemon service doesn't work for me. How can I access the devpi container from another container without having to use --net=host every time?</p>