#清华:
https://mirrors.tuna.tsinghua.edu.cn/help/docker-ce/
systemctl enable docker
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo yum remove docker docker-common docker-selinux docker-engine sudo yum install -y yum-utils device-mapper-persistent-data lvm2 wget -O /etc/yum.repos.d/docker-ce.repo https://download.docker.com/linux/centos/docker-ce.repo sudo sed -i 's+download.docker.com+mirrors.tuna.tsinghua.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo sudo yum makecache fast sudo yum install docker-ce
#国内服务器:
sudo yum install -y yum-utils device-mapper-persistent-data lvm2 sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo sudo yum makecache fast sudo yum -y install docker-ce systemctl start docker systemctl enable docker #我的镜像设置 sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://zxgo7wgr.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker
#Docker卸载:
yum list installed | grep docker
yum -y remove
#阿里云网址:
https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors
https://yq.aliyun.com/articles/110806?spm=5176.8351553.0.0.12721991TdP6oL
#海外服务器:
https://phoenixnap.com/kb/how-to-install-docker-centos-7
Docker:
sudo yum check-update
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y docker
sudo systemctl start docker
sudo systemctl enable docker
Docker Compose安装:
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose --version