docker
2024/5/10小于 1 分钟
docker
安装docker
- 卸载旧版本
$ sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine- 安装依赖
$ sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2- 设置稳定的仓库
$ sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo- 安装最新版docker
$ sudo yum install docker-ce docker-ce-cli containerd.io设置阿里云镜像
https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors
安装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
//如果速度太慢可以换成下面的地址执行
#$ curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.5/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
$ curl -SL https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose设置开机服务
systemctl enable docker.service