https://segmentfault.com/a/1190000021593244
另一种安装方式 https://blog.csdn.net/u011333324/article/details/100181104 (推荐)
https://blog.csdn.net/bashendixie5/article/details/109525871
$ yum install -y yum-utils \
yum install -y device-mapper-persistent-data \
yum install -y lvm2
yum install -y docker
systemctl start docker
systemctl status docker
docker version
开机自启 sudo systemctl enable docker
docker-compose安装
yum install -y docker-compose-plugin
docker compose version
或者
运行以下命令以下载 Docker Compose 的当前稳定版本:
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
要安装其他版本的 Compose,请替换 1.24.1。
// https://github.com/docker/compose/releases?page=16 docker-compose-Linux-x86_64
将可执行权限应用于二进制文件:
$ sudo chmod +x /usr/local/bin/docker-compose
创建软链:
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
测试是否安装成功:
$ docker-compose --version
cker-compose version 1.24.1, build 4667896b
1.报错:docker启动失败
Failed to start Docker Application Container Engine.
修改 /etc/docker/daemon.json 加上如下的键值:
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}
然后重启docker即可 systemctl start docker
参考:https://blog.csdn.net/qq_43159578/article/details/123417292
2.没有可用软件包 docker-ce
https://blog.csdn.net/weixin_45764765/article/details/125240288
3.镜像加速
https://blog.csdn.net/weixin_47556601/article/details/123316884
vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://17o3zxc0.mirror.aliyuncs.com"]
}
//重启镜像
systemctl daemon-reload
systemctl restart docker.service