Official base image with the Unity CLI for installing and running the Headless Unity Editor
491
unity/editor-base is a slim Linux base image for running the Unity Headless Editor in a Docker container. It ships with the Unity CLI and the system prerequisites, so studios can install the Headless Editor 6000.7 or later and build their own image for CI/CD workflows.
The Editor isn't preinstalled. You add the Editor version and the modules for your build targets in your own Dockerfile, push the result to your own registry, and run one container per build job. The Headless Editor is available only for Linux x86_64 and runs in batch mode with no display, GPU or Unity Hub.
Maintained by: Unity Technologies
Where to get help: Unity Editor Workflows Discussions
Pin a version tag or a digest, never latest. A version tag picks up Unity's security rebuilds of that version. A digest changes only when you change it.
docker pull unity/editor-base:1.0.0
Install the Editor and only the modules you build for. Build one image per Editor version and set of build targets, and reuse it for every job. The --headless option installs the Headless Editor instead of the Editor with a graphical interface.
# Pin the base image to a version tag or a digest, never latest.
FROM unity/editor-base:1.0.0
# Every AAC audio import, including in Web builds, needs FFmpeg, which Unity can't ship in the image.
RUN apt-get update \
&& apt-get install -y --no-install-recommends ffmpeg \
&& rm -rf /var/lib/apt/lists/*
ARG UNITY_VERSION=6000.7.0f1
# Install the Headless Editor and modules into a shared folder, accepting the Unity terms.
# The CLI extracts files owned by uid 1000. Make the install root-owned and readable by everyone
# in the same step, so the change doesn't copy the whole Editor into a second layer.
ENV UNITY_NON_INTERACTIVE=1
RUN unity install-path -s /opt/unity/editors \
&& unity install --accept-eula --cm "${UNITY_VERSION}" --headless -m webgl android \
&& unity terms accept ${UNITY_VERSION} --yes \
&& unity cache clean -y \
&& chown -R root:root /opt/unity/editors \
&& chmod -R a+rX /opt/unity/editors
# Run as a nonroot user. The base image defines none; Ubuntu's ubuntu user is uid 1000.
USER ubuntu
WORKDIR /workspace
docker build --build-arg UNITY_VERSION=6000.7.0f1 \
-t ghcr.io/my-studio/unity-editor:6000.7.0f1-webgl-android .
docker push ghcr.io/my-studio/unity-editor:6000.7.0f1-webgl-android
Don't run the Editor as root. By default the CLI installs where Unity Hub does, under the installing user's home (~/Unity/Hub/Editor), which other users can't reach. This Dockerfile installs the Editor at /opt/unity/editors/<version>/Editor/Unity, owned by root and readable by every user, so the ubuntu user can run the Editor but can't modify it.
Create a services-config.json with your license server's address and toolset, and mount it when you start the container, so one image works with different license servers:
{
"licensingServiceBaseUrl": "http://license-server.example.internal:8080",
"toolset": "<your toolset>"
}
For more client options, refer to Licensing client configuration.
docker run --rm \
--shm-size=8g \
--cpus=8 --memory=16g \
--user "$(id -u):$(id -g)" \
-e HOME=/tmp \
-v "$PWD/MyProject":/workspace/project \
-v "$PWD/services-config.json":/usr/share/unity3d/config/services-config.json:ro \
ghcr.io/my-studio/unity-editor:6000.7.0f1-webgl-android \
/opt/unity/editors/6000.7.0f1/Editor/Unity \
-batchmode -nographics \
-projectPath /workspace/project \
-buildTarget WebGL \
-executeMethod BuildScript.BuildWeb \
-logFile - \
-quit
BuildScript.BuildWeb is a static build method in your project. For an example, refer to Build with Unity in a Docker container.--shm-size=8g is required. Docker's default 64 MB of shared memory makes the Editor exit at startup.--user runs the Editor as your user, so the files it writes to mounted folders belong to you, not root. -e HOME=/tmp gives it a writable home folder.-logFile - sends the Editor log to standard output, so docker logs and your build agent capture it.-quit exits the Editor when the build method returns, which also returns the license.Library folder to mounted folders.0 means the build succeeded.Unity signs released images with its code-signing certificate using Notation. With a Notation trust store and trust policy that trust Unity's signing certificate, verify with:
notation verify docker.io/unity/editor-base:1.0.0
The trust policy accepts any certificate that chains to DigiCert, so also check that Unity is the signer. docker pull and docker push don't copy the signature, so mirror the image with a tool that follows OCI referrers, such as ORAS. For the steps for both, refer to Verify the Unity Editor base image signature.
| Tag | Example | Moves | Use it for |
|---|---|---|---|
| Version | 1.0.0 | Yes. Points to security rebuilds of the same contents. | Production builds that pick up security fixes. |
| Version with update suffix | 1.0.0-1 | Yes. Points to security rebuilds. | Production builds after an out-of-band component update, such as a newer Unity CLI. |
| Minor version | 1.0 | Yes. Points to the newest release of that minor version, and never to an older version. | Production builds that also pick up patch releases and update suffixes. |
latest | latest | Yes. Points to the newest release, including security rebuilds, and never to an older version. | Trying out the image. |
| Digest | @sha256:<digest> | No. | Byte-for-byte reproducible builds. |
Pre-release versions end in aN, bN or rcN, such as the current 1.0.0, and don't get a minor version tag. The first minor version tag, 1.0, arrives with the 1.0.0 release. There's no major-only tag.
An automated weekly check rebuilds the image when Ubuntu has pending security updates or Docker Scout finds fixable Critical or High vulnerabilities, and moves the version tag to the rebuild. A newer Unity CLI gets an update suffix, such as 1.0.0-1. A changed Dockerfile gets a new version. Unity tests each new image and publishes it for review, then releases and signs it manually.
| Area | Included | Not included |
|---|---|---|
| OS | Ubuntu 24.04, linux/amd64 | Arm64 |
| Unity | Unity CLI 1.0.0-beta.17 at /usr/local/bin/unity | Editor, modules |
| Libraries | libGL and Mesa (the Editor links against them; it renders nothing), Python 3 for Web builds, libxml2 for the FBX importer, ICU, CA certificates, libcurl | Xvfb, FFmpeg, test tooling |
| Container setup | en_US.UTF-8 locale, writable XDG_RUNTIME_DIR for the licensing client, ALSA null sink, fallback fonts with CJK coverage | A user of its own |
The image runs as root by default. Ubuntu's built-in ubuntu user (uid 1000) is available.
Install FFmpeg if any audio clip imports as AAC, which includes every Web build. Android builds need the Android SDK, NDK and OpenJDK versions your Editor version expects. Install them with the module through the CLI (--cm).
Requirements: Ubuntu Linux x86_64 host with Docker Engine 23.0 or later, at least 8 CPU cores and 16 GB of memory, disk space for an image of about 6 GB with the Editor and one module, and network access to Docker Hub, the Unity download servers, the Unity package registry and your license server.
Unity’s software in this image and Unity’s packaging are subject to the Unity Terms of Service. Installing the Editor with Unity CLI is also subject to those terms, which you accept with:
unity terms accept <version> --yes
This image also contains third-party software, including Ubuntu and its packages. Each component stays under its own license (including GPL and LGPL licenses), and nothing in the Unity Terms of Service limits your rights under those licenses. License texts and copyright notices are in /usr/share/doc/<package>/copyright and summarized in /usr/share/doc/unity-editor-base/NOTICES. The image’s SBOM lists every component and version.
Source code for the Ubuntu packages is available from Ubuntu at https://launchpad.net/ubuntu/+source/<source-package>/<version>. Unity hasn’t modified these packages. We keep source available for each image version we publish for at least three years after publication, and will provide it on request at [email protected].
Ubuntu is a registered trademark of Canonical Ltd. Docker is a trademark of Docker, Inc., Linux® is the registered trademark of Linus Torvalds
Content type
Image
Digest
sha256:c834603fb…
Size
139.8 MB
Last updated
8 days ago
docker pull unity/editor-base