1.安装docker
yum install docker
查看docker版本
docker version
2.启动docker服务,并且设置为开机启动
systemctl start docker.service systemctl enable docker.service
3.配置镜像加速器(阿里云)
sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["你的阿里容器加速源"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker
4.查看docker运行状态
systemctl status docker
Docker-compose基于Python开发,所以我们可以使用pip进行安装。 1.安装pip
curl -s https://bootstrap.pypa.io/pip/2.7/get-pip.py | python (python2.7)
2.安装docker-compose
pip install docker-compose
3.查看安装是否成功
docker-compose -v