CentOS 8 docker/docker-compose 安装
linux版本:
lsb_release -a
配置镜像加速器(此配置来自阿里云)
针对Docker客户端版本大于 1.10.0 的用户
您可以通过修改daemon配置文件/etc/docker/daemon.json来使用加速器
sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://iqrahpvn.mirror.aliyuncs.com"] } EOF
## 设置开机启动
sudo systemctl daemon-reload
sudo systemctl restart docker ## 安装好后再执行
安装依赖
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
#如果没有vpn 建议安装阿里云的 :
yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/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.6-3.3.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
删除
yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine
安装docker-compose
docker-compose版本选择
curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose
查看docker-compose
版本
cker-compose version