1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| 1.确认是否有旧版本docker。有的话卸载 yum list installed | grep docker (查询) yum remove -y docker-ce.x86_64 docker-client.x86_64 docker-common.x86_64(卸载) 2.安装需要的依赖包 yum install -y yum-utils device-mapper-persistent-data lvm2 yum install -y epel-release 3.添加阿里云库 yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo 4.安装插件 dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.4.3-3.1.el7.x86_64.rpm #更换环境如果报错缺失某个containerd.io版本,可以到连接中更换版本地址在线安装 5.安装docker yum install -y docker-ce 6.启动docker并检测: systemctl start docker.service docker version systemctl status docker systemctl enable docker.service(开机启动)
----------------------------------------- 1.安装docker-compose curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.5/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose 2.更改权限 chmod +x /usr/local/bin/docker-compose 3.查看版本 docker-compose --version
|