移除老的
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
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
设置安装:
sudo yum-config-manager --enable docker-ce-edge
安装:
sudo yum install docker-ce -y
启动:
sudo systemctl start docker
添加到系统自动启动:
sudo systemctl enable docker.service
docker-compose 安装命令
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
修改权限:
sudo chmod +x /usr/local/bin/docker-compose
确定版本:
docker-compose --version