脚本安装docker 错误解决

一、脚本安装

  CentOS系统上可以使用此脚本进行安装:

      如下:

[root@localhost ~]# curl -sSL get.docker.com -o get-docker.sh
[root@localhost ~]# sh get-docker.sh --mirror Aliyun

错误:

[root@localhost ~]# sh get-docker.sh --mirror Aliyun
# Executing docker install script, commit: 26ff363bcf3b3f5a00498ac43694bf1c7d9ce16c
+ sh -c 'yum install -y -q yum-utils'
+ sh -c 'yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo'
Loaded plugins: fastestmirror
adding repo from: https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
grabbing file https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
+ '[' stable '!=' stable ']'
+ sh -c 'yum makecache'
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
CentOS7.0                                                                       | 3.6 kB  00:00:00
docker-ce-stable                                                                | 3.5 kB  00:00:00
(1/4): docker-ce-stable/x86_64/filelists_db                                     |  21 kB  00:00:00
(2/4): docker-ce-stable/x86_64/updateinfo                                       |   55 B  00:00:00
(3/4): docker-ce-stable/x86_64/primary_db                                       |  45 kB  00:00:00
(4/4): docker-ce-stable/x86_64/other_db                                         | 114 kB  00:00:00
Metadata Cache Created
+ '[' -n '' ']'
+ sh -c 'yum install -y -q docker-ce'
Error: Package: containerd.io-1.2.13-3.2.el7.x86_64 (docker-ce-stable)
           Requires: container-selinux >= 2:2.74
Error: Package: 3:docker-ce-19.03.12-3.el7.x86_64 (docker-ce-stable)
           Requires: container-selinux >= 2:2.74
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

出现上述错误,解决方法如下:

[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@localhost ~]# yum install epel-release -y
[root@localhost ~]# yum install container-selinux

启动:

[root@localhost ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.

查看,出现client与engine之后说明安装与启动成功:

[root@localhost ~]# docker version
Client: Docker Engine - Community
 Version:           19.03.12
 API version:       1.40
 Go version:        go1.13.10
 Git commit:        48a66213fe
 Built:             Mon Jun 22 15:46:54 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.12
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.10
  Git commit:       48a66213fe
  Built:            Mon Jun 22 15:45:28 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

 

 

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
要使用wget安装Docker,可以使用以下命令从https://get.docker.com获取并运行Docker安装脚本:wget -qO- https://get.docker.com/ | sh。这个命令会将Docker安装脚本下载到本地,并通过Shell中的管道方式执行该脚本,从而完成Docker安装。\[1\]另外,如果你想在服务器上手动下载Docker安装包,可以使用wget命令下载特定版本的Docker安装包,例如:wget https://download.docker.com/linux/static/stable/x86_64/docker-18.06.3-ce.tgz。\[2\]请注意,如果在安装过程中出现"ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"的错误提示,这意味着Docker没有成功启动。你可以尝试启动Docker服务来解决这个问题。 #### 引用[.reference_title] - *1* *3* [Docker安装](https://blog.csdn.net/adrian_boy/article/details/122634621)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [liunx CenterOS 等操作系统使用wget安装使用docker容器](https://blog.csdn.net/qq_42526963/article/details/109536521)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值