设置docker yum源
wget http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo
安装docker(Docker从1.13.x版本开始,版本分为企业版EE和社区版CE,版本号改为按照时间线发布,17.03就是2017年3月)
#安装ce会安装docker-ce-cli containerd.io依赖包等等
[root@localhost ~]# yum -y install docker-ce
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@localhost ~]# mkdir /etc/docker
[root@localhost ~]# cat >> /etc/docker/daemon.json <<EOF
> {
> "registry-mirrors": [
> "https://registry.docker-cn.com",
> "http://hub-mirror.c.163.com",
> "https://docker.mirrors.ustc.edu.cn"
> ]
> }
> EOF
[root@localhost ~]# systemctl start docker
通过pip 安装(生产环境建议使用高版本python)
[root@localhost ~]# yum install epel-release -y
[root@localhost ~]# cd /usr/local/src
[root@localhost src]# wget https://bootstrap.pypa.io/2.7/get-pip.py
[root@localhost src]# python get-pip.py
[root@localhost src]# pip install docker-compose
至此docker-compose安装结束