ubuntu terminal 安装docker

安装docker

说明:本文使用.deb包安装docker

移除安装过得或者旧版本的docker(根据实际情况操作):

$ sudo apt-get remove docker docker-engine docker.io containerd runc

下载deb包:https://download.docker.com/linux/ubuntu/dists/

选择你系统的版本,我的是bionic,并点击进入pool/stable/

安装.deb,-i 后加.deb的路径

$ sudo dpkg -i /path/to/package.deb

 验证是否安装成功:

$ sudo docker run hello-world

  此命令下载测试图像并在容器中运行它。容器运行时,它会打印参考消息并退出。

如果报错:docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.

解决:https://blog.youkuaiyun.com/loovelj/article/details/91418524

 

参考:

官网:https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-using-the-convenience-script

查看系统版本:https://blog.youkuaiyun.com/xiang_shao344/article/details/82806148

使用docker拉取镜像失败:

报错:docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled

           或者Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: TLS handshake timeout

解决:https://blog.youkuaiyun.com/BigData_Mining/article/details/87869147(推荐使用方法一)

     注意:

         1. 如果这里重启失败,报错Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.

           解决:重新编辑daemon.json,检查文件中是否有中文标点,如果文件中有文字标红,则一定有中文标点,将其修改为英文标点,重启docker即可

         2. 如果进入文件夹/etc/docker/权限不够,报错:bash: cd: /etc/docker: 权限不够

           解决:https://blog.youkuaiyun.com/u014717036/article/details/70338463

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值