Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RUN pip install: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed [duplicate]

Tags:

python

docker

ssl

Following the lab from [GitHub][1] to learn more about Docker containers, I felt in this problem:

No matching distribution found for Flask==0.10.1 (from -r /usr/src/app/requirements.txt (line 1))
  Could not fetch URL https://pypi.python.org/simple/flask/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726) - skipping```


  [1]: https://github.com/docker/labs/blob/master/beginner/chapters/webapps.md
like image 456
Roberto Borges Avatar asked Dec 22 '22 23:12

Roberto Borges


1 Answers

The problem is related to the fact that I'm in a network behind a BlueCoat (kind of firewall) which inspect and hide almost of the communication from my desktop and the internet.

After fell googles seach I've found the command to ignore the certificat problem:

Just add this to my dockerfile --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org

# our base image
FROM alpine:3.5

# Install python and pip
RUN apk add --update py2-pip

# install Python modules needed by the Python app
COPY requirements.txt /usr/src/app/
RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org --no-cache-dir -r /usr/src/app/requirements.txt

# copy files required for the app to run
COPY app.py /usr/src/app/
COPY templates/index.html /usr/src/app/templates/

# tell the port number the container should expose
EXPOSE 5000

# run the application
CMD ["python", "/usr/src/app/app.py"]
like image 113
Roberto Borges Avatar answered Jan 05 '23 01:01

Roberto Borges