一.基于 centos 的 rpm 方式部署 docker
1)添加 docker 的软件源
[root@docker ~]#curl -s -o /etc/yum.repos.d/docker-ce.repo https://download.docker.com/linux/centos/docker-ce.repo
2)查看现有的 docker 版本
[root@docker ~]#yum list docker-ce --showduplicates | sort -r
3)安装指定的 docker 版本
[root@docker ~]#yum -y install docker-ce-20.10.24 docker-ce-cli-20.10.24 containerd.io docker-compose-plugin
4) 配置 docker 的镜像加速
参考链接:
# https://www.runoob.com/docker/docker-mirror-acceleration.html
[root@docker ~]#mkdir -p /etc/docker
[root@docker ~]#tee /etc/docker/daemon.json <<-'EOF'
> {
> "registry-mirrors": ["https://tuv7rqqq.mirror.aliyuncs.com","https://docker.mirrors.ustc.edu.cn/","https://hub-mirror.c.163.com/","https://reg-mirror.qiniu.com"]
> }
> EOF
[root@docker ~]#systemctl daemon-reload
[root@docker ~]#systemctl enable --now docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@docker ~]#docker version
5) 新手必备自动补全功能
[root@docker ~]#yum -y install bash-completion
[root@docker ~]#source /usr/share/bash-completion/bash_completion
6) 彩蛋
[root@docker ~]#docker run --restart unless-stopped -dp 80:80 jasonyin2020/oldboyedu-games:v0.4
7)windows 添加hosts解析
10.0.0.101 game01.oldboyedu.com
10.0.0.101 game02.oldboyedu.com
10.0.0.101 game03.oldboyedu.com
10.0.0.101 game04.oldboyedu.com
10.0.0.101 game05.oldboyedu.com
10.0.0.101 game06.oldboyedu.com
10.0.0.101 game07.oldboyedu.com
10.0.0.101 game08.oldboyedu.com
10.0.0.101 game09.oldboyedu.com
10.0.0.101 game10.oldboyedu.com
10.0.0.101 game11.oldboyedu.com
10.0.0.101 game12.oldboyedu.com
10.0.0.101 game13.oldboyedu.com
10.0.0.101 game14.oldboyedu.com
10.0.0.101 game15.oldboyedu.com
10.0.0.101 game16.oldboyedu.com
10.0.0.101 game17.oldboyedu.com
7)访问浏览器测试
http://game01.oldboyedu.com/
标签:oldboyedu,容器,0.101,部署,root,10.0,Docker,com,docker From: https://www.cnblogs.com/liyebo/p/17766476.html