centos7安装docker,清华大学源

#uninstall docker
sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine


#install docker tools
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2

#Tsinghua University yum repository
sudo yum-config-manager \
--add-repo \
https://mydream.ink/utils/container/docker-ce.repo

#install docker-ce
sudo yum install docker-ce docker-ce-cli containerd.io

#image speed up 
mkdir -p /etc/docker
cat <<EOF >>/etc/docker/daemon.json
{
    "registry-mirrors": [
        "https://dockerhub.azk8s.cn",
        "https://reg-mirror.qiniu.com"
    ]
}
EOF

#start docker
sudo systemctl daemon-reload
sudo systemctl start docker

#stop swap
swapoff -a
sed -i -e '/swap/d' /etc/fstab
echo 'vm.swappiness=0' > /etc/sysctl.d/k8s.conf
sysctl -p /etc/sysctl.d/k8s.conf

  

 
posted on 2020-01-02 23:20  michaelz0  阅读(206)  评论(0编辑  收藏  举报