安装docker:http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 docker-engine
在安装docker时遇到如下错误:After this operation, 93.0 MB of additional disk space will be used.Err:1 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 docker-engine amd64 17.05.0~c...
在安装docker时遇到如下错误:
After this operation, 93.0 MB of additional disk space will be used.
Err:1 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 docker-engine amd64 17.05.0~ce-0~ubuntu-xenial 404 Not Found [IP: 116.211.153.234 80]
E: Failed to fetch http://mirrors.aliyun.com/docker-engine/apt/repo/pool/main/d/docker-engine/docker-engine_17.05.0~ce-0~ubuntu-xenial_amd64.deb 404 Not Found [IP: 116.211.153.234 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
错误返回的是Not Found 404,没有找到相应链接的网页.很显然,所以用这种方法走不通.
下面尝试着直接运行
sudo apt install docker.io
完成安装之后,通过
docker version
来检验安装是否成功,若显示如下则成功
Client:
Version: 17.03.2-ce
API version: 1.27
Go version: go1.6.2
Git commit: f5ec1e2
Built: Thu Jul 5 23:07:48 2018
OS/Arch: linux/amd64
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.27/version: dial unix /var/run/docker.sock: connect: permission denied
但是现在还有一个小问题,就是在当前用户运行docker会显示权限不够,即permission denied。
解决:
docker守护进程启动的时候,会默认赋予名字为docker的用户组读写Unix socket的权限,因此只要创建docker用户组,并将当前用户加入到docker用户组中,那么当前用户就有权限访问Unix socket了,进而也就可以执行docker相关命令
sudo groupadd docker #添加docker用户组
sudo gpasswd -a $USER docker #将登陆用户加入到docker用户组中
newgrp docker #更新用户组
docker ps #测试docker命令是否可以使用sudo正常使用
更多推荐
所有评论(0)