This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资源工作流程
版本控制
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

在Docker容器中运行基于UNIGINE的应用程序

You can run a UNIGINE-based application (whether it is a third-party solution or the one you've developed yourself) inside a Docker container you have already configured.您可以在已配置Docker容器中运行基于UNIGINE的应用程序(无论是第三方解决方案还是您自己开发的解决方案)。

First, prepare the application that you want to run:首先,准备要运行的应用程序:

  1. Download it from an external resource or, if it is your application, create a final Release build.从外部资源下载它,或者,如果它是您的应用程序,请创建最终的发布版本
  2. Move the application with all its content and additional libraries (if any) to the Docker-related folder (unigine-in-docker):将应用程序及其所有内容和其他库(如果有)移动到Docker相关文件夹(unigine-in-docker):

    输出
    $ mv cpp_samples/  ~/unigine-in-docker/
    $ mv csharp_component_samples/ ~/unigine-in-docker/

Running C# and C++ UNIGINE-based applications slightly differs, so here as an example we use the C++ Samples and C# Component Samples demos included in UNIGINE SDK.运行基于C#和C++UNIGINE的应用程序略有不同,因此这里作为示例,我们使用UNIGINE SDK中包含的C++ SamplesC# Component Samples演示。

Running C++ Application
运行C++应用程序
#

  1. Enable connections with the X-server:启用与X-server的连接:

    输出
    $ xhost +local:*
  2. Launch the C++ application:启动C++应用程序:

    输出
    $ cd ~/unigine-in-docker/
    $ docker run -it --rm \
    --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`/cpp_samples:/opt/project \
    -v /etc/localtime:/etc/localtime:ro \
    -w /opt/project/bin/ \
    run_unigine_in_docker:latest \
    ./cpp_samples_x64

Running C# Application
运行C#应用程序
#

  1. Enable connections with the X-server:启用与X-server的连接:

    输出
    $ xhost +local:*
  2. Launch the C# application:启动C#应用程序:

    输出
    $ cd ~/unigine-in-docker/
    $ docker run -it --rm \
    --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`/csharp_component_samples:/opt/project \
    -v /etc/localtime:/etc/localtime:ro \
    -w /opt/project/bin/ \
    run_unigine_in_docker:latest \
    dotnet csharp_component_samples_x64.dll -console_command "world_load csharp_samples"

Congratulations! You have successfully run a UNIGINE-based application in a Docker container!恭喜您!您已经成功地在Docker容器中运行了一个基于unigine的应用程序!

最新更新: 2024-04-23
Build: ()