【发布时间】:2019-09-18 12:20:59
【问题描述】:
我正在尝试构建 docker 映像的 docker 实例中运行 docker。然而,在构建过程中,一切都挂在pipe install 命令上。我的基础镜像是 nvidia/cuda:10.1-base-ubuntu16.04。
这是我试图在我的 Dockerfile 中运行的命令
python -m pip --no-cache-dir --default-timeout=1000 install -U jupyter \
jupyter_contrib_nbextensions \
jupytext -vvv &&\
这里有详细的日志
Collecting jupyter
1 location(s) to search for versions of jupyter:
* https://pypi.org/simple/jupyter/
Getting page https://pypi.org/simple/jupyter/
Found index url https://pypi.org/simple
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "GET /simple/jupyter/ HTTP/1.1" 200 496
Analyzing links from page https://pypi.org/simple/jupyter/
Found link https://files.pythonhosted.org/packages/83/df/0f5dd132200728a86190397e1ea87cd76244e42d39ec5e88efd25b2abd7e/jupyter-1.0.0-py2.py3-none-any.whl#sha256=5b290f93b98ffbc21c0c7e749f054b3267782166d72fa5e3ed1ed4eaf34a2b78 (from https://pypi.org/simple/jupyter/), version: 1.0.0
Found link https://files.pythonhosted.org/packages/c9/a9/371d0b8fe37dd231cf4b2cff0a9f0f25e98f3a73c3771742444be27f2944/jupyter-1.0.0.tar.gz#sha256=d9dc4b3318f310e34c82951ea5d6683f67bed7def4b259fafbfe4f1beb1d8e5f (from https://pypi.org/simple/jupyter/), version: 1.0.0
Found link https://files.pythonhosted.org/packages/fc/21/a372b73e3a498b41b92ed915ada7de2ad5e16631546329c03e484c3bf4e9/jupyter-1.0.0.zip#sha256=3e1f86076bbb7c8c207829390305a2b1fe836d471ed54be66a3b8c41e7f46cc7 (from https://pypi.org/simple/jupyter/), version: 1.0.0
Given no hashes to check 3 links for project 'jupyter': discarding no candidates
Using version 1.0.0 (newest of versions: 1.0.0)
Created temporary directory: /tmp/pip-unpack-i95zt6ip
Starting new HTTPS connection (1): files.pythonhosted.org:443
还有其他运行的日志
Collecting jupyter
1 location(s) to search for versions of jupyter:
* https://pypi.org/simple/jupyter/
Getting page https://pypi.org/simple/jupyter/
Found index url https://pypi.org/simple
Starting new HTTPS connection (1): pypi.org:443
如您所见,它挂在Starting new HTTPS connection (1): 上,有时它通过第一个但在第二个失败。
我根据其他答案添加了--no-cache-dir 和--default-timeout=1000,但这对我没有帮助。我的 pip install 工作过一次,但在我有 -vvv 选项之前,所以不知道它如何完成,但是我的 Dockerfile 包含三个 pip install 命令,后来它在第二个命令上失败了。
最大的问题是我无法获得构建该 docker 映像的机器的配置,当我在本地尝试时,一切正常。是一个pip install 还是多个都没关系。
所以,我的问题是:pip 在那一刻挂起的原因是什么?
【问题讨论】:
-
你使用哪个基础镜像?
-
@LinPy 我正在使用 nvidia/cuda:10.1-base-ubuntu16.04
-
建议你先尝试更新pip
-
@LinPy 谢谢,但没有帮助。