加载中...

Docker Yum部署


1.1 配置第三方yum源

yum -y install yum-utils
mv /etc/yum.repos.d/dvd.repo{,.bak}
wget -O /etc/yum.repos.d/centos-base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

1.2 生成缓存

yum makecache fast
yum repolist

1.3 安装Docker依赖

yum -y install yum-utils device-mapperpersistent-data lvm2
yum -y install docker-ce

1.4 配置Docker镜像加速

mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
    "registry-mirrors":
    ["https://ww9b0ehc.mirror.aliyuncs.com"]
}
EOF


1.5 启动

systemctl daemon-reload
systemctl restart docker

1.6 查看版本

docker version
docker info
# 添加内核参数防止报错
vim /etc/sysctl.conf
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1

文章作者: huhuhahei
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 huhuhahei !
评论
  目录