Obtaining Container Images:

Writing Dockerfiles

Write your own Dockerfiles to build Unreal Engine containers.

This topic is not recommended for beginners.

Although writing your own Dockerfiles provides the greatest flexibility, it also involves understanding and addressing a number of technical complexities related to both the Unreal Engine itself and Docker containers in general. Before writing your own Dockerfiles, we strongly recommended exploring the other available sources of container images and carefully studying the existing Dockerfiles.

Contents

Introduction

This page aims to provide general guidance for developers who wish to write their own Dockerfiles for building Unreal Engine containers that include the Engine Build Tools. This guidance takes the form of a set of brief tips, organised into platform-based sections below. Most of these tips are derived from experience gained during the development of the ue4-docker project, and contain a number of references to the documentation and source code for that project. Nevertheless, the information presented on this page is designed to be implementation-agnostic, and applies to any Dockerfiles written for the Unreal Engine, irrespective of the infrastructure that is used to build them.

It is worth noting that the tips on this page relate only to writing Dockerfiles and not to configuring the environment or infrastructure that will be used to build the final container images. For details on environment configuration, see the Environment Setup section of the Unreal Containers community hub documentation.

Platform-agnostic considerations

Writing Dockerfiles for Linux containers

General tips

Tips for working with NVIDIA Docker

# Connect to the host's PulseAudio server using the mounted UNIX socket
default-server = unix:/run/user/1000/pulse/native

# Prevent a PulseAudio server from running in the container
autospawn = no
daemon-binary = /bin/true

# Prevent the use of shared memory
enable-shm = false

Writing Dockerfiles for Windows containers

References