docker初学安装
#更换yum源 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all yum makecache #yum更新到最新 yum update reboot
#安装docker yum install -y yum-utils device-mapper-persistent-data lvm2 yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo yum -y install docker-ce docker-ce-cli containerd.io
#镜像加速 vi /etc/docker/daemon.json { "registry-mirrors":[ "http://hub-mirror.c.163.com", "https://hub-mirror.c.163.com/", "https://docker.mirrors.ustc.edu.cn", "https://reg-mirror.qiniu.com" ] } #重启docker systemctl restart docker
#安装docker-compose工具(可直接下载后上传至服务器) curl -L https://github.com/docker/compose/releases/download/1.25.5/docker-compose-Linux-x86_64 -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose #部署环境 docker-compose up -d