离线部署最新稳定版docker-ce

参考博客:https://blog.csdn.net/JyuSun/article/details/77927865#commentBox

以下centos-local.tgz已打包完成,打包过程可参考以上链接可在百度网盘上下载

链接:https://pan.baidu.com/s/1FfLNBLtICEkSljTQgkuu8Q
提取码:j5ad

tar -xvzf centos-local.tgz
cd docker-ce-local
# 安装createrepo
rpm -ivh deltarpm-3.6-3.el7.x86_64.rpm
rpm -ivh python-deltarpm-3.6-3.el7.x86_64.rpm
rpm -ivh createrepo-0.9.9-28.el7.noarch.rpm
# 将所有的安装源移动到备份文件夹中
cd /etc/yum.repos.d/
mkdir repobak
mv CentOS* repobak/
vi /etc/yum.repos.d/docker-ce-local.repo
-------
[docker-ce-local]
name=Local Yum
baseurl=file:///root/docker-ce-local/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
------------
如果不对,修改
gpgkey=file:///root/docker-ce-local/gpg
~~~~~~~~~~~~~~~~~~~~~~~~
# 生成源索引及缓存
createrepo /root/docker-ce-local
yum makecache
# 安装docker-ce
yum install docker-ce
docker version

(1)记得修改你存放docker-ce-local的目录,修改以上地址,上文是/root/docker-ce-local/
(2)在服务器上部署时,由于一般没有root权限,记得加上sudo
(3)当查看docker version,若出现Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? 需进行如下操作

systemctl daemon-reload
sudo service docker restart
sudo service docker status   # (should see active (running))

(4)当发现启动docker后,原有的可连通的网段不能telnet 22、不能ping通时,查看是否网桥占用,使用ifconfig查看docker的网桥,修改

sudo vi /etc/docker/daemon.json
{"bip":"192.168.0.1/16"}
sudo service docker restart

你可能感兴趣的:(k8s搭建)