sudo dnf -y install yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
访问 镜像资料 获取最新的安装包
dnf -y install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.13-3.2.el7.x86_64.rpm
docker-ce
、docker-ce-cli
sudo dnf -y install docker-ce docker-ce-cli
docker
# 启动
sudo systemctl start docker
# 查看状态
systemctl status docker
# 停止
systemctl stop docker
docker
版本docker version
sudo systemctl enable docker
docker-compose
方法一:
curl -L https://github.com/docker/compose/releases/download/1.26.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose
版本docker-compose version
方法二:
1、安装python-pip
yum -y install epel-release
dnf install -y python3
dnf install python3-paramiko
2、安装docker-compose
pip3 install docker-compose