Docker and docker-compose快速安装

来自linux中国网wiki
docker>Evan2019年8月6日 (二) 03:07的版本
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航 跳到搜索

docker docker-compose

#install docker
yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-selinux \
                  docker-engine-selinux \
                  docker-engine

yum install -y yum-utils \
           device-mapper-persistent-data \
           lvm2
           
yum-config-manager \
    --add-repo \
    https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo
    
yum makecache fast
yum install docker-ce -y   
systemctl enable docker
systemctl start docker


yum -y install vim wget curl yum-utils bash-completion bash-completion-extras epel-release lrzsz telnet python-pip
pip install docker-compose

mkdir -p /home/data/docker

echo '{"graph": "/home/data/docker"}' >/etc/docker/daemon.json
# cat /etc/docker/daemon.json 
{"graph": "/home/data/docker"}

systemctl restart docker

#验证docker储存位置
docker system info | grep "Root Dir"