Files
OpenRCT2-Web/docs/docker-dev.md
T

2.0 KiB

Docker Development Environment

This repository can be built and run in a Linux container using the files in docker/dev/.

What OpenRCT2 needs to build

From this repository's CMake files and Debian packaging metadata, Linux builds require:

  • Build tools: C++20 compiler, cmake (3.24+), ninja, pkg-config, git
  • Core libraries: libzip, libpng, zlib, libzstd, libicu, nlohmann-json
  • Networking/security: openssl, libcurl
  • Fonts/UI: freetype, fontconfig, sdl2
  • Audio: libflac, libogg, libvorbis
  • GUI rendering: OpenGL development headers (libgl1-mesa-dev)

The docker/dev/Dockerfile installs these dependencies.

Build the container

cd docker/dev
docker compose build

To run as your local uid/gid (avoids root-owned files), pass them at build time:

USER_UID=$(id -u) USER_GID=$(id -g) docker compose build

Start a development shell

cd docker/dev
docker compose run --rm openrct2-dev

Build OpenRCT2 inside the container

Use the project build wrapper and disable install-time asset downloads for local development:

. scripts/setenv -q
scripts/build \
  -DCMAKE_BUILD_TYPE=Debug \
  -DDOWNLOAD_TITLE_SEQUENCES=OFF \
  -DDOWNLOAD_OBJECTS=OFF \
  -DDOWNLOAD_OPENSFX=OFF \
  -DDOWNLOAD_OPENMUSIC=OFF \
  -DDOWNLOAD_REPLAYS=OFF

Run OpenRCT2 inside the container

Version check:

./bin/openrct2 --version
./bin/openrct2-cli --version

Run the game (requires original RCT2 assets):

./bin/openrct2 --rct2-data-path /opt/rct2-data

/opt/rct2-data is mounted read-only from ${RCT2_DATA_PATH} on the host.

Linux GUI forwarding (optional)

For GUI rendering from container to host X11:

xhost +local:docker
cd docker/dev
docker compose run --rm \
  -e DISPLAY \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  -v /dev/dri:/dev/dri \
  openrct2-dev \
  ./bin/openrct2 --rct2-data-path /opt/rct2-data
xhost -local:docker

If you only need server/headless workflows, use openrct2-cli and skip GUI forwarding.