pip 镜像源更改
项目采用python作为后台开发语言,制作镜像时采用 pip默认的镜像源(部署在国外),下载速度很慢,导致多次制作失,具体dockerfile内容:
FROM python:3.6.2
MAINTAINER LI
WORKDIR /usr/src/test
ADD ./test/ ./
RUN pip install py2neo && pip install pandas && pip install tornado
CMD ["python","/usr/src/test/start_server.py"]
查阅资料后改为阿里云镜像源,镜像很快制作成功,具体dockerfile内容:
FROM python:3.6.2
MAINTAINER LI
WORKDIR /usr/src/test
ADD ./test/ ./
RUN pip install -i https://mirrors.aliyun.com/pypi/simple/ --no-cache-dir -r requirement.txt
CMD ["python","/usr/src/test/start_server.py"]
国内还有清华、中国科技大的镜像源,自行查阅,应用方式相同