一、安装依赖
[root@docker02 ~]# sudo yum install -y yum-utils device-mapper-persistent-data lvm2
二、软件源信息
[root@test1 ~]# sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
三、更新并安装 Docker-CE
[root@docker02 ~]# sudo yum makecache fast
[root@docker02 ~]# sudo yum -y install docker-ce
四、配置docker
[root@docker02 ~]# systemctl start docker
[root@docker02 ~]# sudo tee /etc/docker/daemon.json <<-'EOF'
{
"data-root": "/data/docker",
"storage-driver": "overlay2",
"registry-mirrors": ["https://yx8zsx76.mirror.aliyuncs.com"]
}
EOF
重新加载linux docker服务
[root@docker02 ~]# sudo systemctl daemon-reload
[root@docker02 ~]# sudo systemctl restart docker
[root@docker02 ~]# systemctl enable docker.service
五、安装docker-compose
- 先安装python3环境
[root@docker02 ~]# yum -y install epel-release
[root@docker02 ~]# yum -y install python36 python36-devel
[root@docker02 ~]# wget -P /tmp/ https://bootstrap.pypa.io/get-pip.py
[root@docker02 ~]# /bin/python3 /tmp/get-pip.py
- 安装docker-compose
[root@docker02 ~]# pip3 install docker-compose
留言