Dockerfile 如下
FROM python:2.7
LABEL maintainer="xiaodao11 295621649@qq.com"
RUN pip install flask
COPY app.py /app/
WORKDIR /app
EXPOSE 5000
CMD ["python","app.py"]
docker build ....报错 ..
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/selectivesearch/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._ve.............
环境是阿里云 服务器 centos 7
https://blog.csdn.net/pipisorry/article/details/50805379
http://blog.csdn.net/anxpp/article/details/52495309
已经。讲 vim /etc/docker daemon.json 里的源换掉即可
http://dockone.io/article/2499,参考一下
总结:我也碰到这个问题,修改Dockerfile的pip来源就好了
Dockerfile使用的python3.7作为基础镜像 FROM python:3.7,但是执行
RUN pip install --no-cache-dir -r requirements.txt
是默认走了这个源,https://files.pythonhosted.org/packages,编译用时太久。
无赖修改成国内源来加快编译速度:
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --no-cache-dir -r requirements.txt