{"id":1083,"date":"2022-04-23T14:04:19","date_gmt":"2022-04-23T05:04:19","guid":{"rendered":"https:\/\/colory-games.net\/site\/?p=1083"},"modified":"2023-04-20T20:43:00","modified_gmt":"2023-04-20T11:43:00","slug":"use-unreal-engine-container-images-with-docker-en","status":"publish","type":"post","link":"https:\/\/colory-games.net\/site\/en\/use-unreal-engine-container-images-with-docker-en\/","title":{"rendered":"Use Unreal Engine Container Images with Docker"},"content":{"rendered":"\n<div class=\"wp-block-jetpack-markdown\"><p>The Unreal Engine officially provides container images.<br>\nDocker allows you to launch containers from container images and create an individual Unreal Engine environment.<br>\nThis article explains the benefits of using Unreal Engine container images and how to build Unreal Engine projects and plugins.<\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#Container_Images_Provided_by_the_Unreal_Engine_Official\">Container Images Provided by the Unreal Engine Official<\/a><\/li><li><a href=\"#Advantages_of_Using_Containers\">Advantages of Using Containers<\/a><\/li><li><a href=\"#How_to_Launch_a_Container\">How to Launch a Container<\/a><\/li><li><a href=\"#Build_a_project_in_a_container\">Build a project in a container<\/a><\/li><li><a href=\"#Build_a_Plugin_in_a_Container\">Build a Plugin in a Container<\/a><\/li><li><a href=\"#References\">References<\/a><\/li><\/ul><\/div>\n<h2><span id=\"Container_Images_Provided_by_the_Unreal_Engine_Official\">Container Images Provided by the Unreal Engine Official<\/span><\/h2>\n<p>Container images for the Unreal Engine are provided on Epic Games&#8217; GitHub Organization page.<br>\nOn the GitHub Organisation page, navigate to [Packages] &gt; [unreal-engine] to see a list of available container images.<br>\nYou must have a permission to access the Unreal Engine source code in order to pull container images.<br>\nSee <a href=\"https:\/\/www.unrealengine.com\/ja\/ue4-on-github\">Documentation<\/a> to get access permissions in advance.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/colory-games.net\/site\/wp-content\/uploads\/tech-blog\/nutti\/2022\/04\/20220423\/unreal-engine-conatiner-images.png?ssl=1\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/colory-games.net\/site\/wp-content\/uploads\/tech-blog\/nutti\/2022\/04\/20220423\/unreal-engine-conatiner-images.png?ssl=1\" alt=\"Unreal Engine Container Image\" data-recalc-dims=\"1\"><\/a><\/p>\n<p>The provided container images are for Unreal Engine versions &quot;4.27&quot; or lateer.<br>\nThe tag name with &quot;slim&quot; are container images which reduces the image size through optimization.<br>\nNon-optimized container images have a very large image size, it is recommended to use &quot;slim&quot; version.<\/p>\n<h2><span id=\"Advantages_of_Using_Containers\">Advantages of Using Containers<\/span><\/h2>\n<p>The advantage of using containers is that you can build the Unreal Engine environment separately from the host environment.<br>\nEach containers are independent and can be stored as images.<br>\nThis makes it easy to migrate your own modified environment to other systems.<br>\nFor example, if you need to add your own third-party libraries in the Unreal Engine, you need to migrate the third-party libraries as well when you migrate your environment.<br>\nIf you convert it to a container image when your work is complete, only you need to migrate is simply bringging the container image to another environment.<\/p>\n<p>You can use containers for the following purposes.<\/p>\n<ul>\n<li>Eliminate problems caused by environment dependencies by using the Unreal Engine separate from the host environment.<\/li>\n<li>Share development environments among multiple users.<\/li>\n<li>Continuous testing and build (CI\/CD).<\/li>\n<\/ul>\n<p>This article explains how to build Unreal Engine projects and plug-ins in containers.<\/p>\n<h2><span id=\"How_to_Launch_a_Container\">How to Launch a Container<\/span><\/h2>\n<p>This section describes how to obtain the pull images to launch containers.<br>\nThere are many ways to obtain container images, but we will use <a href=\"https:\/\/www.docker.com\/\">Docker<\/a> in this article.<\/p>\n<h3>Docker<\/h3>\n<p>To use Docker on Windows, download and install the installer from the <a href=\"https:\/\/www.docker.com\/\">official Docker page<\/a>.<br>\nAfter installation, you use Docker on Windows after Docker Desktop is started.<\/p>\n<p>For more information, please refer to <a href=\"https:\/\/docs.docker.jp\/docker-for-windows\/install.html\">official documentation<\/a>.<\/p>\n<h3>Get the Get Container Image command<\/h3>\n<p>Go to the Epic Games&#8217; GitHub Organization page, and select Packages &gt; unreal-engine.<br>\nClick on [dev-slim-5.0.0] to get a command to pull the container image with the tag <code>dev-slim-5.0.0<\/code>.<br>\nThen, copy the displayed command.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/colory-games.net\/site\/wp-content\/uploads\/tech-blog\/nutti\/2022\/04\/20220423\/unreal-engine-conatiner-image-dev-slim-5.0.0.png?ssl=1\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/colory-games.net\/site\/wp-content\/uploads\/tech-blog\/nutti\/2022\/04\/20220423\/unreal-engine-conatiner-image-dev-slim-5.0.0.png?ssl=1\" alt=\"Container Image (dev-slim-5.0.0)\" data-recalc-dims=\"1\"><\/a><\/p>\n<h3>Pull a Container Image<\/h3>\n<p>To pull the container image on Windows, open a command prompt and run the command you copied.<br>\nTo pull the container image, you will need to login by using the <code>docker login<\/code> command, since pulling the container image needs to  access the Unreal Engine source code.<br>\nYou will be asked for the username and password, so enter the username and password of your GitHub account (or a token with <code>read:package<\/code> permissions).<\/p>\n<pre><code class=\"language-bash\">docker login ghcr.io\n<\/code><\/pre>\n<p>Once you have successfully logged in, you will be able to pull the container image.<br>\nTo pull a container image with the tag <code>dev-slim-5.0.0<\/code>, run the following command.<\/p>\n<pre><code class=\"language-bash\">docker pull ghcr.io\/epicgames\/unreal-engine:dev-slim-5.0.0\n<\/code><\/pre>\n<p>To verify the pulled container image, run the command <code>docker images<\/code>.<br>\nIf the container image was successfully pulled, you can see the pulled image in the result of the command.<\/p>\n<pre><code class=\"language-bash\">$ docker images\nREPOSITORY                           TAG                   IMAGE ID       CREATED         SIZE\nghcr.io\/epicgames\/unreal-engine      dev-slim-5.0.0        a9edd4a7beb3   2 weeks ago     35.7GB\n<\/code><\/pre>\n<h3>Launch a Container<\/h3>\n<p>To launch the container, run the following command.<\/p>\n<pre><code class=\"language-bash\">docker run -it ghcr.io\/epicgames\/unreal-engine:dev-slim-5.0.0 \/bin\/bash\n<\/code><\/pre>\n<p>Run the above command, and enter the container environment.<br>\nSince the container environment is Linux, you can run the basic Linux commands.<br>\nIf you try the <code>ls<\/code> command, you will see a list of files and directories located in the directory.<br>\nBy default, you can see the directory <code>Engine<\/code>.<\/p>\n<pre><code class=\"language-bash\">$ ls\nEngine\n<\/code><\/pre>\n<h2><span id=\"Build_a_project_in_a_container\">Build a project in a container<\/span><\/h2>\n<p>To build a Unreal Engine project in a container, use [AutomationTool](https:\/\/docs.unrealengine.com\/4.27\/ja\/ProductionPipelines\/BuildTools\/ AutomationTool\/Overview\/).<br>\nTo build the project, run the subcommand <code>BuildCookRun<\/code> of the command <code>RunUAT.sh<\/code>.<br>\nBelow command will place <code>.uproject<\/code> file in <code>\/path\/to\/SampleProject.uproject<\/code> and the built data will be placed in <code>\/tmp\/Packaged<\/code>.<\/p>\n<pre><code class=\"language-bash\">\/home\/ue4\/UnrealEngine\/Engine\/Build\/BatchFiles\/RunUAT.sh BuildCookRun \\\n    -utf8output \\\n    -platform=Linux \\\n    -clientconfig=Shipping \\\n    -serverconfig=Shipping \\\n    -project=\/path\/to\/SampleProject.uproject \\\n    -noP4 \\\n    -nodebuginfo \\\n    -allmaps \\\n    -cook \\\n    -build \\\n    -stage \\\n    -prereqs \\\n    -pak \\\n    -archive \\\n    -archivedirectory=\/tmp\/Packaged\n<\/code><\/pre>\n<p>If the command is executed correctly, the following log is output.<\/p>\n<pre><code class=\"language-bash\">...\nBUILD SUCCESSFUL\nAutomationTool executed for 0h 6m 4s\nAutomationTool exiting with ExitCode=0 (Success)\n<\/code><\/pre>\n<h2><span id=\"Build_a_Plugin_in_a_Container\">Build a Plugin in a Container<\/span><\/h2>\n<p>The process of the building a plugin is the almost same by using the Automation Tool.<br>\nTo build a plugin, use the subcommand <code>BuildPlugin<\/code> of the command <code>RunUAT.sh<\/code>.<br>\nBelow command will place <code>.uplugin<\/code> file in <code>\/path\/to\/SamplePlugin.uplugin<\/code> and the built data will be placed in <code>\/tmp\/Packaged<\/code>.<\/p>\n<pre><code class=\"language-bash\">\/home\/ue4\/UnrealEngine\/Engine\/Build\/BatchFiles\/RunUAT.sh BuildPlugin \\\n    -Plugin=\/path\/to\/SamplePlugin.uplugin \\\n    -Package=\/tmp \\\n    -Rocket\n<\/code><\/pre>\n<p>If the command is executed correctly, the following log is output.<\/p>\n<pre><code class=\"language-bash\">...\nBUILD SUCCESSFUL\nAutomationTool executed for 0h 0m 22s\nAutomationTool exiting with ExitCode=0 (Success)\n<\/code><\/pre>\n<h2><span id=\"References\">References<\/span><\/h2>\n<ul>\n<li><a href=\"https:\/\/www.docker.com\/\">Docker<\/a><\/li>\n<li><a href=\"https:\/\/docs.docker.jp\/\">Docker-docs-ja<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/EpicGames\">Epic Games &#8211; GitHub<\/a><\/li>\n<li><a href=\"https:\/\/www.unrealengine.com\/en-US\/ue-on-github\">Unreal Engine on GitHub &#8211; Unreal Engine<\/a><\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The Unreal Engine officially provides container images.<br \/>\nDocker allows you to launch containers from container images and create an individual Unreal Engine environment.<br \/>\nThis article explains the benefits of using Unreal Engine container images and how to build Unreal Engine projects and plugins.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"templates\/single-home-techblog.php","format":"standard","meta":{"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":false,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[94,71],"tags":[47],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/posts\/1083"}],"collection":[{"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/comments?post=1083"}],"version-history":[{"count":4,"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/posts\/1083\/revisions"}],"predecessor-version":[{"id":1155,"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/posts\/1083\/revisions\/1155"}],"wp:attachment":[{"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/media?parent=1083"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/categories?post=1083"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/colory-games.net\/site\/wp-json\/wp\/v2\/tags?post=1083"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}