docker部署

Posted on 2023-03-13 18:34  zhousha1111  阅读(34)  评论(0编辑  收藏  举报
docker部署
第一步:设置 yum 源为 docker  yum源
cd /etc/yum.repos.d/
rm -rf *.repo
wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum clean all
yum makecache
第二步:安装 docker 依赖软件
yum install -y container-selinux
yum install -y slirp4netns
yum install -y fuse-overlayfs
第三步:把 yum 源切换成 dockeer yum 源
cd /etc/yum.repo.d/
wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
mv  CentOS7-Base-163.repo  CentOS7-Base-163.repo.bak
yum clean all
yum makecache
第四步:安装 docker
yum install -y docker-ce
第五步:启动 docker 服务
Service firewalld stop   #关闭防火墙
Service docker start    # 启动docker服务
Service docker stop   # 停止docker服务
Service docker restart   # 重启docker服务
第六步:配置镜像加速
进入 /etc/docker/ 目录,添加文件 daemon.json
Vi daemon.json,内容如下:
{
  "registry-mirrors": ["https://akchsmlh.mirror.aliyuncs.com"]
}
重新加载刚配置文件:
sudo  /bin/systemctl  daemon-reload
重启docker:
service docker restart

Copyright © 2025 zhousha1111
Powered by .NET 9.0 on Kubernetes