Skip to content

Docker (Linux + Windows cross-compile)#

The docker/ directory provides a reproducible environment for producing Linux x64, Windows x64, and Windows x86 binaries from a single host.

Requirements#

  • Docker Engine 20.10+
  • Docker Compose v2

What's in the image#

The docker/Dockerfile builds a Debian 13-Slim image with:

  • Clang + libc++ / lld for native Linux builds
  • llvm-mingw for Windows x64 and x86 cross-compilation
  • DirectXShaderCompiler (DXC)
  • SDL3 system dependencies
  • CMake, Ninja, Python 3, git

The CPM dependency cache lives in a named Docker volume (cpm-cache) and is reused across builds.

Layout#

docker/
  Dockerfile
  docker-compose.yml
  .dockerignore
  toolchains/
    x86_64-w64-mingw32.cmake
    i686-w64-mingw32.cmake
  out/

Services#

Service Description
extract Extracts game assets
linux-x64 Native Linux build, outputs tp_pc and .AppImage
windows-x64 64-bit Windows cross-compile, outputs tp_pc.exe
windows-x86 32-bit Windows cross-compile, outputs tp_pc.exe

All build services depend on extract, so asset extraction runs automatically.

Usage#

cd docker

Extract assets only:

docker compose run --rm extract

Build a single target:

docker compose run --rm linux-x64
docker compose run --rm windows-x64
docker compose run --rm windows-x86

Build everything:

docker compose up

Tip

The first run builds the image and populates the CPM cache. Subsequent builds reuse both.

Outputs#

docker/out/linux-x64/tp_pc
docker/out/windows-x64/tp_pc.exe
docker/out/windows-x86/tp_pc.exe

Rebuilding the image#

docker compose build

To wipe the CPM cache:

docker compose down -v

See also#