1 安装 Docker Community Engine
主要参考:https://docs.docker.com/install/linux/docker-ce/centos/
安装版本库
代码语言:javascript复制sudo yum install -y yum-utils
device-mapper-persistent-data
lvm2
代码语言:javascript复制sudo yum-config-manager
--add-repo
https://download.docker.com/linux/centos/docker-ce.repo
安装 DOCKER ENGINE - COMMUNITY
代码语言:javascript复制sudo yum install docker-ce docker-ce-cli containerd.io
代码语言:javascript复制sudo systemctl start docker
验证
代码语言:javascript复制sudo docker run hello-world
2 安装 docker-compose
主要参考:https://docs.docker.com/compose/install/
安装
代码语言:javascript复制sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
代码语言:javascript复制sudo chmod x /usr/local/bin/docker-compose
如果失败了
代码语言:javascript复制sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
验证
代码语言:javascript复制docker-compose --version