Kbengine游戏引擎-【5】用Dockerfile打包镜像kbengine
本文是以docker为例,以ubuntu 16.04做基础镜像
kengine 1.0.0 用supervisor来管理启动
先放下目录结构图:
kb--里面放的是kbengine的编译后的引擎以及demo


参考案例:https://github.com/Yenole/kbengine-docker/blob/master/Dockerfile
不过他这个写的我没实现成功
一、Dockerfile文件
FROM ubuntu:16.04
LABEL maintainer="116.com"
# 设置工作目录
WORKDIR /
# 更新并安装环境
RUN apt update
RUN apt install libmysqlclient-dev -y #数据库管理器(DBMgr)会用到,不然这个进程起不了,无法连接数据库
RUN apt install mysql-client -y
#解压安装引擎
COPY kb /
# 添加demo
RUN useradd kbe #安装supervisord #让supervisord启动在前端,这样不会down掉
RUN apt install supervisor -y
RUN chmod /etc/supervisor/supervisord.conf
COPY supervisord.conf /etc/supervisor/supervisord.conf
# 映射端口
EXPOSE
EXPOSE
EXPOSE
CMD ["/usr/bin/supervisord","-n","-c","/etc/supervisor/supervisord.conf"]
二.supervisord.conf文件
; supervisor config file [unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
chmod= ; sockef file mode (default ) [supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) ; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface [supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket ; The [include] section can just contain the "files" setting. This
; setting can list multiple files (separated by whitespace or
; newlines). It can also contain wildcards. The filenames are
; interpreted as relative to this file. Included files *cannot*
; include files themselves. [include]
files = /etc/supervisor/conf.d/*.conf
[program:kbe2]
user=kbe
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"
directory=/kbengine/assets/
command=/bin/sh start_server.sh
autostart=true
autorestart=true
[program:django]
directory=/kbengine/kbe/tools/server/webconsole/
command=/bin/sh run_server.sh
autostart=true
autorestart=true
三、构建镜像
docker build -t kbengine:v1 .
四、注意事项
1.提先要把数据库准备好,建好库已经用户密码。
2.环境变量问题
Kbengine游戏引擎-【5】用Dockerfile打包镜像kbengine的更多相关文章
- # 通过 DockerFile 打包镜像
在介绍 Docker 具体的操作前,先简要复习下 Docker 的架构,这样可以更好地帮助我们理解 Docker 中的各个命令. 首先我们一直对 Docker 这个叫法就有些误解,Docker 其实指 ...
- Kbengine游戏引擎-【4】demo-kbengine_unity3d_demo 在容器docker上安装测试
git地址:https://github.com/kbengine/kbengine_unity3d_demo Demo中文地址:https://github.com/kbengine/kbengin ...
- Kbengine游戏引擎-【2】kbengine引擎服务端目录结构分析
|- kbengine (KBE_ROOT 根目录) |- demo (游戏例子工程的根目录) |- res (工程的所有资源) |- spaces (通常存放游戏场景相关的资源,例如Navmesh) ...
- Kbengine游戏引擎-【1】kbengine安装
本文主要介绍如何在Linux上安装 官网环境要求:Centos >= 5.x, Debian >= 5.x GCC版本: >= 4.4.x 官网链接 本文的安装环境介绍:Centos ...
- Docker Dockerfile 定制镜像(转)
转自: https://yeasy.gitbooks.io/docker_practice/ 及 https://blog.csdn.net/wo18237095579/article/details ...
- 【2D游戏引擎】WIP反思
WIP(Working In Progress)是我初学游戏引擎开发时候开发的一个2D游戏引擎,当时计划为它实现类似Unity一样的编辑器,具有和Unity相似的工作流,但是由于水平不够,走了很多弯路 ...
- Docker Dockerfile 定制镜像
使用 Dockerfile 定制镜像 镜像的定制实际上就是定制每一层所添加的配置.文件.如果我们可以把每一层修改.安装.构建.操作的命令都写入一个脚本,用这个脚本来构建.定制镜像,那么无法重复的问题 ...
- Docker用Dockerfile定制镜像
用Dockerfile定制镜像 镜像的定制实际上就是定制每一层所添加的配置.文件.如果我们可以把每一层修改.安装.构建.操作的命令都写入一个脚本,用这个脚本来构建.定制镜像,那之前提示的无法重复的问题 ...
- 开源免费的HTML5游戏引擎
青瓷引擎的成长 青瓷引擎自2015年4月项目启动开始,7月首次亮相2015年ChinaJoy,便得到业界的极大关注,随后开启限量测试,收到数百个开发者团队的试用申请及反馈,期间经历了18个内测版本,完 ...
随机推荐
- Spring之Redis访问(Spring-data-redis)
Spring-data-redis,是spring-data框架中,比较常用的,基于key-value键值对的数据持久层框架.Spring-data-redis,是一个基于Template模板开发的数 ...
- DICOM文件修改方法
/// <summary> /// 读取dicom文件 /// </summary> /// <param name="srcdirectory"&g ...
- mORMot学习笔记2-2种方式查询数据
本例使用SqlServer 第一种方式结果放入Memo控件,,需要引用SynCommons, SynDB, SynOleDb; procedure TForm1.Button1Click(Sender ...
- Delphi 数组特性
- Android Vitals各性能指标介绍
Android vitals 简介 谷歌推荐使用Android vitals来帮助开发者提高App的稳定性和性能表现. 作为这个方案的一部分, Play Console提供了Android Vital ...
- Math.pow
一个Math函数,例如:Math.pow(4,3);返回4的三次幂,用法:Math.pow(x,y) x 必需传.底数.必须是数字. y 必需传.幂数.必须是数字. 如果结果是虚数或负数,则该方法将返 ...
- mongodb的安装与使用(二)之 增删改查与索引
0.MongoDB数据库和集合创建与删除 MongoDB 创建数据库 语法: use DATABASE_NAME note:查看所有数据库使用show dbs 创建的空数据库 test并不在数据库的列 ...
- iterm2 "agnoster"主题设置中的一些踩坑 2018.8
主线教程:https://www.cnblogs.com/xishuai/p/mac-iterm2.html (1)在链接的“3.配置oh My zsh”中,编辑vim~/.zshrc后两下回车,然后 ...
- [React] Create a Persistent Reference to a Value Using React useRef Hook
The useRef is a hook for creating values that persist across renders. In this lesson we'll learn how ...
- Centos创建用户并授权
创建新用户 [root@VM ~]# adduser it为这个用户初始化密码,linux会判断密码复杂度,不过可以强行忽略:[root@VM_~]# passwd itChanging passwo ...