I am building a dockerfile with the docker build . command. While building, I am experiencing the following error:

Downloading/unpacking requests
   Cannot fetch index base URL http://pypi.python.org/simple/
   Could not find any downloads that satisfy the requirement requests
   No distributions at all found for requests

Here is the dockerfile:

FROM jonasbonno/rpi-grovepi
RUN pip install requests
RUN git clone https://github.com/keyban/fogservice.git #update
ENTRYPOINT ["python"]
CMD ["fogservice/service.py"]

What might be the problem?

1 Answers

1
Pablo López Gallego On Best Solutions

You have a pip problem, not a docker problem, you need to add pip install --index-url https://pypi.python.org/simple/ --upgrade pip to your docker file:

FROM jonasbonno/rpi-grovepi
RUN pip install --index-url https://pypi.python.org/simple/ --upgrade pip
RUN hash -r
RUN pip install requests
RUN git clone https://github.com/keyban/fogservice.git #update
ENTRYPOINT ["python"]
CMD ["fogservice/service.py"]

You can find the solution here: pip connection failure: cannot fetch index base URL http://pypi.python.org/simple/