/ Docker / 39浏览

[Docker] Compose安装

Docker 安装

# 卸载老版本Docker
sudo 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

# 添加docker下载仓库
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

# 安装docker-ce
sudo yum install docker-ce

# 启动docker-ce
sudo systemctl start docker

# 验证
sudo docker --version

sudo docker run hello-world

Docker Compose 安装

yum install epel-release
yum install -y python-pip
pip install docker-compose