在Docker容器中开发UNIGINE项目
To implement container-based development workflow for UNIGINE-based projects (i.e. to use UnigineEditor to create and edit worlds and run your application) you need to launch UNIGINE SDK Browser inside a Docker container. Configure the Docker container first, or if it is already configured, follow these steps:要为基于UNIGINE的项目实现基于容器的开发工作流程(即使用UnigineEditor创建和编辑世界并运行应用程序),您需要在Docker容器内启动UNIGINE SDK 浏览器。首先配置Docker容器,或者如果已经配置,请按照以下步骤操作:
- Download and install UNIGINE SDK Browser (version 2.0.13+)下载并安装UNIGINE SDK 浏览器(版本2.0.13及更高)
- Launch SDK Browser in the container.在容器中启动SDK 浏览器。
SDK Browser Downloading and InstallationSDK浏览器下载安装#
- Download SDK Browser (for Linux) and save it as sdk_browser2_latest.run to the target folder (unigine-in-docker).SDK 浏览器(适用于Linux)并将其保存为sdk_browser2_latest.run到目标文件夹(unigine-in-docker)。
-
Run the following commands from the unigine-in-docker folder to unpack and install SDK Browser:在unigine-in-docker目录下执行如下命令解包并安装SDK 浏览器:
$ cd ~/unigine-in-docker $ chmod +x sdk_browser2_latest.run $ ./sdk_browser2_latest.run $ chmod +x UNIGINE_SDK_Browser2/browser2.run
During the installation you should read and accept the license terms.在安装过程中,您应该阅读并接受许可条款。
SDK Browser Launch in the ContainerSDK浏览器在容器中启动#
-
Enable connections with the X-server:启用与X-server的连接:
$ xhost +local:*
-
Launch SDK Browser:启动SDK Browser:
$ docker run -it --rm --network host \ --runtime=nvidia --gpus 0 -e NVIDIA_VISIBLE_DEVICES=0 \ -e DISPLAY=${DISPLAY} \ --device /dev/snd \ -e NVIDIA_DRIVER_CAPABILITIES=display,compute \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -v `pwd`/UNIGINE_SDK_Browser2:/opt/browser2 \ -v `pwd`/tmp/config:/root/.config/ \ -v `pwd`/unigine/config_browser:/root/.config/unigine \ -v `pwd`/unigine/config_editor:/root/.config/Unigine \ -v `pwd`/unigine/local/share:/root/.local/share/unigine/browser \ -v `pwd`/unigine/projects:/root/Documents/ \ -v /etc/localtime:/etc/localtime:ro \ -w /opt/browser2/ \ run_unigine_in_docker:latest \ ./browser2.run
Congratulations! You have successfully launched SDK Browser in Docker! Now you can develop your project in UnigineEditor or run an Engine instance (your application).恭喜您!您已经成功地在Docker中启动了SDK 浏览器!现在,您可以在UnigineEditor中开发项目或运行引擎实例(您的应用程序)。