赞
踩
目录
Docker刚安装后执行docker ps -a报错(centos)
Dockerfile中用pip install命令一直retry,容器中pip确是可以下载的
需要更改一下默认的下载地址
cd /etc/docker
配置镜像位置
- vim daemon.json
- {
- "registry-mirrors":["https://almtd3fa.mirror.aliyuncs.com"]
- }
重启docker
systemctl daemon-reload && systemctl restart docker
在启动docker容器的时候挂载以下两个目录
- -v /usr/bin/docker:/usr/bin/docker
- -v /var/run/docker.sock:/var/run/docker.sock
通过yum install -y docker安装docker后,执行docker ps -a检查一下是否docker已运行。
- [root@localhost]# docker ps -a
- Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
这个情况是没有运行docker导致的。。。所以启动一下docker就可以。
- [root@localhost]# docker ps -a
- Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
- [root@localhost]# systemctl start docker
- [root@localhost]# docker ps -a
- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
- [root@localhost]# systemctl enable docker
- Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
- root@lenovo-PC:/home/lenovo/project/docker/jupyter# docker-compose build
- Building jupyterlab
- Step 1/2 : FROM jupyter/base-notebook
- ---> a954c1f0a0b5
- Step 2/2 : RUN pip install jupyter-lsp && jupyter labextension install @krassowski/jupyterlab-lsp && pip install python-language-server[all]
- ---> Running in c39ac0a04176
- WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fcf3a995eb0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/jupyter-lsp/
- WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fcf3a9b9100>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/jupyter-lsp/
- WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fcf3a9b92b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/jupyter-lsp/
可能是docker的dns问题,在daemon.json中增加dns后重启下docker
- vim /etc/docker/daemon.json
- {
- "registry-mirrors":["https://almtd3fa.mirror.aliyuncs.com"],
- "dns": ["114.114.114.114", "8.8.8.8"]
- }
-
-
- service docker restart
在某OS的docker 18的版本上发生这样的错,手动更新docker至24.0.5版本后解决
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。