CentOS7 安装 Docker 和 Docker-compose

1、安装 Docker

# 安装依赖
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2

# 添加docker下载仓库
sudo yum-config-manager \
--add-repo \
https://download.docker.com/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

2、安装 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
点赞

发表评论

电子邮件地址不会被公开。必填项已用 * 标注