Skip to content

RFC: CLI-driven Docker image builds — build-unity-image (and future engine variants) #45

@frostebite

Description

@frostebite

Context

From maintainer discussion on game-ci/unity-builder#771 — users need custom module combinations (e.g. Wwise requiring windows-mono + linux-il2cpp) that we don't pre-build. Currently, Docker images are built from static Dockerfiles with hardcoded module matrices in game-ci/docker. Users who need non-standard combinations must build their own images with limited guidance.

Proposal

Add game-ci build-unity-image — a CLI command that fully codifies the game-ci/docker build pipeline, including all version-specific patches, SDK setups, and platform conditionals.

game-ci build-unity-image ubuntu windows-mono,linux-il2cpp --unity-version 2022.3.20f1

Why Deep Integration Matters

This is not a thin wrapper. The generated Dockerfiles include every patch from game-ci/docker:

  • 18 version-specific Ubuntu patches (IL2CPP fixes, WebGL deps, Android SDK setup across 4 generations, server module auto-install, etc.)
  • Full Windows Dockerfile (multi-shell build, MSVCP DLLs, Git, PowerShell Android helpers, service config)

A user gets the exact same image our CI publishes. No missing dependencies, no subtle breakage from skipped patches.

Benefits

  • Users can build any module combination without waiting for us to add it to the matrix
  • No GameCI-hosted infra needed — users self-serve (GHCR is free for public repos)
  • More contributors to CLI — image building is a CLI feature, not scattered Dockerfile knowledge
  • Single source of truth — one tool defines how images are built
  • Eventually our CI dogfoods this — same path for published images and custom ones

Phased Rollout

Phase 1: CLI build-unity-image ✅ (PR #46)

  • Full Dockerfile generation with all patches
  • Auto changeset resolution
  • Custom tags, push support
  • Ubuntu + Windows base OS support

Phase 2: Migrate game-ci/docker CI

  • Replace workflow matrices with game-ci build-unity-image invocations
  • Validate images are byte-identical to current builds
  • Same published tags, same registry

Phase 3: User-facing ecosystem

  • game-ci init generates image build steps in workflows
  • Docs for common combinations (desktop, mobile, desktop+android)
  • Consider reducing the hosted matrix once users can self-serve

No deprecation — existing pre-built images continue indefinitely. This adds capability.

Related

cc @webbertakken @frostebite

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions