https://blog.csdn.net/qq_41709494/article/details/83042130 #如果docker没安装好请看
前提:要安装好docker
cat /etc/redhat-release #查看版本
cat /proc/sys/net/ipv4/ip_forward #查看网络转发是否为“1”
如果不为"1"就要
vi /etc/sysctl.conf
net.ipv4_forward=1
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.all.rp_filter = 0
#在最后面加就可以了
sysctl -p #让网络转发生效
在/etc/docker/daemon.json 中写入如下内容(如果文件不存在请新建该文件)
vi /etc/docker/daemon.json
{
“registry-mirrors”: [
“https://registry.docker-cn.com”
]
}
#这个官网的docker加速有时不行就用下面那个
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://4e70ba5d.m.daocloud.io #docker加速
#生效成这样就行了
#注意:上图是Rancher1.6
sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher #这是Rancher v2.0版本
或docker run -d --restart=always -p 80:80 -p 443:443 rancher/rancher /bin/bash
Rancher搭建
最新推荐文章于 2023-08-26 13:46:45 发布