首页 > 其他分享 >部署 Docker 容器

部署 Docker 容器

时间:2023-10-15 23:56:34浏览次数:37  
标签:oldboyedu 容器 0.101 部署 root 10.0 Docker com docker

一.基于 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

相关文章

  • docker安装配置oracle19c
    1.拉取oracle19c镜像,我这边使用的是:registry.cn-hangzhou.aliyuncs.com/zhuyijun/oracle2.创建Oracle容器: dockerrun-d-p1521:1521--nameoracle19c-dregistry.cn-hangzhou.aliyuncs.com/zhuyijun/oracle:19c  可以看到状态是Starting,具体日志可以查看 dock......
  • Docker安装
    在Linux下安装docker   yum-yinstallgcc   yum-yinstallgcc-c++       #卸载原来的docker   yumremovedocker\                     docker-client\                     docker-client-latest\  ......
  • Docker note
    1.1Docker服务相关命令启动dockers服务:systemctlstartdocker停止dockers服务:systemctlstopdocker重启dockers服务:systemctlrestartdocker查看dockers服务状态:systemctlstatusdocker设置开机启动docker服务:systemctlenabledocker1.2镜像相关命令1.2.1查......
  • LINUX部署服务
    后端服务路径/opt/server前端服务路径/usr/local/nginxMYSQL更换触发器source/usr/t_user_alpha.sqlmysql重启servicemysqldrestart修改文件名mv文件名修改后的文件名进入mysqlmysql-uroot-p添加字段ALTERTABLEstudentADDageINT(4)进入窗口screen-rruoyi查看java进......
  • Docker 安装Redis
    一、下载redis镜像dockerpullredis二、创建数据卷映射路径、配置redis.confmkdir-p/usr/local/myredis/confvimredis.conf#redis.confappendonlyyes配置内容可以参考https://github.com/redis/redis/blob/unstable/redis.conf启用内存过渡分配#修改配......
  • Using Docker Desktop with WSL2
    WindowsSubsystemforLinux(WSL)2isafullLinuxkernelbuiltbyMicrosoft,whichletsLinuxdistributionsrunwithoutmanagingvirtualmachines.WithDockerDesktiprunningonWSL2,userscanleverageLinuxworkspacesandavoidmaintainingbothLinux......
  • ubuntu安装docker
    在Ubuntu上安装Docker非常简单。按照以下步骤进行操作:更新系统软件包列表:CopyCodesudoaptupdate安装必要的软件包,以便使用HTTPS源进行下载:CopyCodesudoaptinstallapt-transport-httpsca-certificatescurlsoftware-properties-common添加Docker官方的GPG......
  • 使用GitHub Actions自动部署Hexo博客
    准备两个仓库源码库:hexo源码仓库网页库:{username}.github.io目标在源码库编写博客,推送到远端后,触发GithubActions。Actions配置hexo环境,生成hexo文件后,推送到网页库。推送网页到网页库的权限问题,通过Github的accesstoken解决(https://github.com/settings/token......
  • docker安装sqlserver2019
    1.拉取镜像dockerpullmcr.microsoft.com/mssql/server:2019-latest2.执行dockerrun命令: dockerrun--namesqlserver-wangmj--hostnamesqlserver-master\-p1434:1433\-e'ACCEPT_EULA=Y'\-e'SA_PASSWORD=sdfasdfasdfsdf?'......
  • docker 迅雷
    从迅雷群晖套件中提取出来用于其他设备的迅雷远程下载服务程序。https://hub.docker.com/r/cnk3x/xunleidockerrun-d--name=xunlei--hostname=mynas--net=host-eXL_WEB_PORT=8321-v/home/cl/docker/xunlei:/xunlei/data-v/home/cl/Downloads:/xunlei/downloads--res......