CentOS 8 安装 docker/docker-compose

安装依赖

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

先装新版的 containerd.io

访问 镜像资料 获取最新的安装包

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-cedocker-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

方法一:

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

你可能感兴趣的:(#,CentOS,#,Docker,docker,centos)