如果之前已有安装有docker需要重新安装,先进行卸载,如果没安装忽略此步骤
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
安装Docker服务
安装yum-utils
安装所需的依赖组件软件包,执行以下命令
yum install -y yum-utils device-mapper-persistent-data lvm2
为yum源添加docker仓库位置
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
安装docker服务
yum -y install docker-ce
docker是否安装成功
docker -v
[root@localhost ~]# docker -v
Docker version 25.0.3, build 4debf41
启动docker服务
systemctl start docker && systemctl enable docker
安装Docker Compose编排工具
在GitHub上下载对应的版本
GitHub地址:https://github.com/docker/compose/releases
wget https://github.com/docker/compose/releases/download/v2.24.5/docker-compose-linux-x86_64
将下载的文件上传到bin目录
mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version
[root@localhost ~]# docker-compose --version
Docker Compose version v2.24.5
重启Docker
systemctl restart docker
标签:compose,步骤,version,yum,Docker,安装,docker
From: https://www.cnblogs.com/sddll/p/18036709