77) Docker-ce 清华源安装
Posted lemanlai
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了77) Docker-ce 清华源安装相关的知识,希望对你有一定的参考价值。
1- CentOS7
1.1- 国内清华源
rm -rf /etc/yum.repos.d/*
curl -o /etc/yum.repos.d/CentOS-Base.repo https://files-cdn.cnblogs.com/files/lemanlai/CentOS-7.repo.sh
curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-7 https://mirror.tuna.tsinghua.edu.cn/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7
yum install epel-release -y
yum clean all
yum makecache fast
yum install nmap telnet curl wget vim lrzsz bind-utils -y #安装基本工具
1.2- docker-ce清华源
yum remove docker docker-common docker-selinux docker-engine -y #如果你之前安装过 docker,请先删掉
yum install -y yum-utils device-mapper-persistent-data lvm2 #安装一些依赖
curl -o /etc/yum.repos.d/docker-ce.repo https://files-cdn.cnblogs.com/files/lemanlai/docker-ce.repo.sh
yum clean all
yum makecache fast
2- ubuntu20.04
2.1- 清华源
cat << EOF > /etc/apt/sources.list
deb https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
EOF
apt-get install nmap telnet curl wget vim lrzsz bind-utils -y #安装基本工具
apt-get update
2.2- docker-ce 清华源
apt-get remove docker docker-engine docker.io -y #如果你过去安装过 docker,先删掉
apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common -y #安装依赖
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - #信任 Docker 的 GPG 公钥
add-apt-repository "deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu $(lsb_release -cs) stable" #添加软件仓库
apt-get update
apt-get install docker-ce
以上是关于77) Docker-ce 清华源安装的主要内容,如果未能解决你的问题,请参考以下文章