Date:2021-02-20
Centos8版本:8.3.2011
- 更新系统依赖
dnf update -y
dnf -y install python3
- 下载docker-ce的repo
curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo
- 安装依赖
wget https://mirrors.aliyun.com/docker-ce/linux/centos/8/x86_64/stable/Packages/containerd.io-1.4.4-3.1.el8.x86_64.rpm
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
yum -y install ./containerd.io-1.4.4-3.1.el8.x86_64.rpm
- 安装docker-ce
yum -y install docker-ce
- 启动docker
systemctl start docker
- 开机启动docker
systemctl enable docker
7.安装docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
8.添加操作权限
sudo chmod +x /usr/local/bin/docker-compose
9.设置快捷
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
10.查看docker-compose 版本
docker-compose --version