本文是以docker为例,以ubuntu 16.04做基础镜像

kengine 1.0.0 用supervisor来管理启动


先放下目录结构图:

kb--里面放的是kbengine的编译后的引擎以及demo

参考案例:https://github.com/Yenole/kbengine-docker/blob/master/Dockerfile

不过他这个写的我没实现成功

一、Dockerfile文件

  1. FROM ubuntu:16.04
  2. LABEL maintainer="116.com"
  3. # 设置工作目录
  4. WORKDIR /
  5. # 更新并安装环境
  6. RUN apt update
  7. RUN apt install libmysqlclient-dev -y #数据库管理器(DBMgr)会用到,不然这个进程起不了,无法连接数据库
  8. RUN apt install mysql-client -y
  9. #解压安装引擎
  10. COPY kb /
  11. # 添加demo
    RUN useradd kbe
  12.  
  13. #安装supervisord #让supervisord启动在前端,这样不会down掉
  14. RUN apt install supervisor -y
  15. RUN chmod /etc/supervisor/supervisord.conf
  16. COPY supervisord.conf /etc/supervisor/supervisord.conf
  17. # 映射端口
  18. EXPOSE
  19. EXPOSE
  20. EXPOSE
  21. CMD ["/usr/bin/supervisord","-n","-c","/etc/supervisor/supervisord.conf"]

二.supervisord.conf文件

  1. ; supervisor config file
  2.  
  3. [unix_http_server]
  4. file=/var/run/supervisor.sock ; (the path to the socket file)
  5. chmod= ; sockef file mode (default )
  6.  
  7. [supervisord]
  8. logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
  9. pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
  10. childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
  11.  
  12. ; the below section must remain in the config file for RPC
  13. ; (supervisorctl/web interface) to work, additional interfaces may be
  14. ; added by defining them in separate rpcinterface: sections
  15. [rpcinterface:supervisor]
  16. supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
  17.  
  18. [supervisorctl]
  19. serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
  20.  
  21. ; The [include] section can just contain the "files" setting. This
  22. ; setting can list multiple files (separated by whitespace or
  23. ; newlines). It can also contain wildcards. The filenames are
  24. ; interpreted as relative to this file. Included files *cannot*
  25. ; include files themselves.
  26.  
  27. [include]
  28. files = /etc/supervisor/conf.d/*.conf
  29. [program:kbe2]
  30. user=kbe
  31. environment=uid="1000",KBE_ROOT="/kbengine",KBE_RES_PATH="$KBE_ROOT/assets/:$KBE_ROOT/assets/scripts/:$KBE_ROOT/assets/res/",KBE_BIN_PATH="$KBE_ROOT/kbe/bin/server"
  32. directory=/kbengine/assets/
  33. command=/bin/sh start_server.sh
  34. autostart=true
  35. autorestart=true
  36. [program:django]
  37. directory=/kbengine/kbe/tools/server/webconsole/
  38. command=/bin/sh run_server.sh
  39. autostart=true
  40. autorestart=true

三、构建镜像

docker build -t kbengine:v1 .

四、注意事项

1.提先要把数据库准备好,建好库已经用户密码。

2.环境变量问题

Kbengine游戏引擎-【5】用Dockerfile打包镜像kbengine的更多相关文章

  1. # 通过 DockerFile 打包镜像

    在介绍 Docker 具体的操作前,先简要复习下 Docker 的架构,这样可以更好地帮助我们理解 Docker 中的各个命令. 首先我们一直对 Docker 这个叫法就有些误解,Docker 其实指 ...

  2. Kbengine游戏引擎-【4】demo-kbengine_unity3d_demo 在容器docker上安装测试

    git地址:https://github.com/kbengine/kbengine_unity3d_demo Demo中文地址:https://github.com/kbengine/kbengin ...

  3. Kbengine游戏引擎-【2】kbengine引擎服务端目录结构分析

    |- kbengine (KBE_ROOT 根目录) |- demo (游戏例子工程的根目录) |- res (工程的所有资源) |- spaces (通常存放游戏场景相关的资源,例如Navmesh) ...

  4. Kbengine游戏引擎-【1】kbengine安装

    本文主要介绍如何在Linux上安装 官网环境要求:Centos >= 5.x, Debian >= 5.x GCC版本: >= 4.4.x 官网链接 本文的安装环境介绍:Centos ...

  5. Docker Dockerfile 定制镜像(转)

    转自: https://yeasy.gitbooks.io/docker_practice/ 及 https://blog.csdn.net/wo18237095579/article/details ...

  6. 【2D游戏引擎】WIP反思

    WIP(Working In Progress)是我初学游戏引擎开发时候开发的一个2D游戏引擎,当时计划为它实现类似Unity一样的编辑器,具有和Unity相似的工作流,但是由于水平不够,走了很多弯路 ...

  7. Docker Dockerfile 定制镜像

    使用 Dockerfile 定制镜像  镜像的定制实际上就是定制每一层所添加的配置.文件.如果我们可以把每一层修改.安装.构建.操作的命令都写入一个脚本,用这个脚本来构建.定制镜像,那么无法重复的问题 ...

  8. Docker用Dockerfile定制镜像

    用Dockerfile定制镜像 镜像的定制实际上就是定制每一层所添加的配置.文件.如果我们可以把每一层修改.安装.构建.操作的命令都写入一个脚本,用这个脚本来构建.定制镜像,那之前提示的无法重复的问题 ...

  9. 开源免费的HTML5游戏引擎

    青瓷引擎的成长 青瓷引擎自2015年4月项目启动开始,7月首次亮相2015年ChinaJoy,便得到业界的极大关注,随后开启限量测试,收到数百个开发者团队的试用申请及反馈,期间经历了18个内测版本,完 ...

随机推荐

  1. 8.Spring整合Hibernate_2_声明式的事务管理(Annotation的方式)

    声明式的事务管理(AOP的主要用途之一) (Annotation的方式) 1.加入annotation.xsd 2.加入txManager bean 3.<tx:annotation-drive ...

  2. asp.net mvc5 DataBase First下model校验问题(MetadataType使用)

    最近学习asp.net mvc5,使用   asp.net mvc5+EF6+AutoFac做个小Demo,其中是先设计的数据库表,就直接选择了EF的DataBase First(三种开发模式分别是c ...

  3. 【python】写csv文件时遇到的错误

    1.错误 在许多文件中,写入csv文件时都加"wb",w指写入,b指二进制 如: csvwrite=csv.writer(open("output.csv",& ...

  4. Linux Centos虚拟机扩容

    Linux Centos虚拟机扩容(/dev/mapper/centos-root) 1:.首先查看我们的根分区大小是多少 df -h 文件系统 类型 容量 已用 可用 已用% 挂载点``/dev/m ...

  5. java与JSON

    XML 格式数据极其的冗长.因为每个离散的数据片段需要大量的 XML 结构,所有有效 的数据的比例非常低.XML 语法还有轻微的模糊.还有,解析 XML 是非常占程序员的精力的.你需要提前了解详细的结 ...

  6. Ubuntu安装libssl-dev失败(依靠aptitude管理降级软件)并记录dpkg展示安装软件列表

    Ubuntu 12.04LTS下直接安装 libssl-dev 失败 提示错误: $ sudo apt-get install libssl-dev Reading package lists... ...

  7. linux基础_使用指令3

    时间日期类 1.date指令 功能:显示当前日期 语法: date:显示当前时间 date +%Y:显示当前年份 date +%m:显示当前月份 date +%d:显示当前是哪一天 date &quo ...

  8. c#系统泛型委托

    Action<T> 无返回值的系统泛型委托 namespace ConsoleApp1 { public class UserInfo { public int Id { get; set ...

  9. Git 命令行解决冲突

    git add filename   将本地工作区文件加入缓存区 git commit filename -m '提交文件注释' git status  查看当前工作区状态 git fetch ori ...

  10. spark-聚合算子aggregatebykey

    spark-聚合算子aggregatebykey Aggregate the values of each key, using given combine functions and a neutr ...