scrapinghub / docker-devpi

pypi caching service using devpi and docker
28 stars 42 forks source link

mirroring does not work when accessed from host machine. #6

Open bhanuvrat opened 8 years ago

bhanuvrat commented 8 years ago

when running from the host machine, pip complains as follows:

➜  ~  pip install -i http://192.168.99.100:3141/root/pypi/ --upgrade flask
Collecting flask
  The repository located at 192.168.99.100 is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host 192.168.99.100'.
  Could not find a version that satisfies the requirement flask (from versions: )
No matching distribution found for flask
➜  ~

while the devpi server running inside the container prints out:

devpi_1    | 2015-10-14 11:04:40,368 INFO  [req18] GET /root/pypi/flask/
devpi_1    | 2015-10-14 11:04:40,375 INFO  [req19] GET /root/pypi/+simple/Flask

At the same time, when requested from inside a container tho whole thing works flawlessly. bug, or am I missing something very obvious?

dangra commented 8 years ago

and have you tried adding --trusted-host 192.168.99.100 ?

dangra commented 8 years ago

I use this image for development on a vagrant machine, my images have the following instruction in its Dockerfile ENV PIP_TRUSTED_HOST 172.17.42.1.

It is interesting that Docker 1.9.0 will finally allow to pass different envvars at docker build time.

bhanuvrat commented 8 years ago

cool. let me try and get back to you.

dangra commented 8 years ago

if you put devpi behind a https url (with valid certificate) it (pip) won't complain.