docker的安装部署
1.防火墙
systemctl disable firewalld
systemctl stop firewalld
2.修改内核参数
cat < /etc/sysctl.d/docker.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.all.rp_filter = 0
net.ipv4.ip_forward=1
EOF
重新加载内核参数
sysctl -p /etc/sysctl.d/docker.conf
3.Yum源配置
配成阿里云yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
配置阿里云专有的docker源
curl -o /etc/yum.repos.d/docker-ce.repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum clean all && yum makecache
验证docker源配置成功否
yum list docker-ce --showduplicates | sort -r
- 安装dockers
yum install docker-ce-20.10.6 -y
5.配置docker加速器
mkdir -p /etc/docker
vi /etc/docker/daemon.json
{
“registry-mirrors” : [
“https://8xpk5wnt.mirror.aliyuncs.com”
]
}
6.docker启动
systemctl daemon-reload --重新编译配置
systemctl enable docker —加入开机自启
systemctl restart docker.service
systemctl status docker.service
用docker命令验证启动是否成功