This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
VR Development
Double Precision Coordinates
API
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
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Running UNIGINE-Based Application in Docker Container

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.

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):

    Output
    $ 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.

Running C++ Application#

  1. Enable connections with the X-server:

    Output
    $ xhost +local:*
  2. Launch the C++ application:

    Output
    $ 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#

  1. Enable connections with the X-server:

    Output
    $ xhost +local:*
  2. Launch the C# application:

    Output
    $ 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!

Last update: 2024-04-23
Build: ()