Files
2026-10-13 20:11:17 +02:00

142 lines
6.5 KiB
YAML

# =============================================================================
# EVO Player - PS5 12.70 homebrew development environment
#
# docker compose build
# docker compose run --rm ps5-dev bash
#
# Use `run`, not `up`. This is a development shell, not a long-running
# service: `docker compose up` starts `bash -l` with nothing attached, so it
# appears to hang until you Ctrl+C. Harmless, but not what you want. Clean up
# after an accidental `up` with `docker compose down`.
#
# NETWORKING (Docker Desktop / Windows) - read docs/networking.md
# This uses the DEFAULT bridge network on purpose.
# * network_mode: host does NOT behave on Windows the way it does on
# Linux. On Docker Desktop the "host" is the WSL2/Hyper-V VM, not your
# Windows machine, so host networking would attach the container to the
# VM's stack - it does not give you the Windows LAN interface.
# * The default bridge already NATs outbound traffic through the VM to
# your LAN, which is all we need: the container is the TCP *client* and
# the PS5 is the server (elfldr listens on 9021).
# So `nc -vz $PS5_HOST 9021` works out of the box with bridge networking.
# No privileged mode, no cap_add, no host networking required.
#
# The one thing bridge networking cannot do is let the PS5 initiate a
# connection *into* the container. Nothing in the ELF workflow needs that,
# but if you later run a listener (e.g. klogsrv catching console output),
# publish the port explicitly - see the commented `ports:` block below.
# =============================================================================
services:
ps5-dev:
build:
context: .
dockerfile: Dockerfile
args:
# Keep these in sync with the pins documented in the Dockerfile header.
UBUNTU_VERSION: "24.04"
LLVM_VERSION: "18"
PS5_SDK_VERSION: "v0.42"
PACBREW_VERSION: "v0.39"
CMAKE_VERSION: "3.31.6"
NINJA_VERSION: "1.12.1"
# Static host zlib for the Phase 1b native-app converter (tools/native-app).
ZLIB_NATIVE_VERSION: "1.3.2"
# 1 = build the SDK from git instead of using the release zip.
BUILD_SDK_FROM_SOURCE: "0"
# 0 = bare SDK, no prebuilt FFmpeg/SDL2 (ProsperoPlayer will not link).
INSTALL_PACBREW: "1"
# Host-matching non-root user inside the container. Default 1001 for
# Docker Desktop (Windows); Linux hosts set HOST_UID/HOST_GID in .env
# (see .env.example) to match their own uid/gid so bind-mounted
# output isn't root- or wrong-uid-owned.
USER_UID: "${HOST_UID:-1001}"
USER_GID: "${HOST_GID:-1001}"
image: ps5-twitch/ps5-dev:llvm18-sdk-v0.42
# A login shell so /etc/profile.d/ps5-sdk.sh runs and exports CC/CXX/...
command: ["/bin/bash", "-l"]
stdin_open: true
tty: true
working_dir: /workspace
environment:
# PS5_HOST is intentionally NOT defaulted to an IP address. Set it in a
# .env file next to this compose file (see .env.example), or per command:
# PS5_HOST=192.168.1.50 docker compose run --rm ps5-dev ./scripts/deploy.sh ...
PS5_HOST: "${PS5_HOST:-}"
# 9021 is the ps5-payload-elfldr port; it is also the default baked into
# host/bin/prospero-deploy and every SDK sample Makefile.
PS5_PORT: "${PS5_PORT:-9021}"
PS5_PAYLOAD_SDK: /opt/ps5-payload-sdk
CCACHE_DIR: /ccache
volumes:
# -- Source of truth stays on Windows -------------------------------
# The whole repository is bind-mounted, so sources, build/, output/elf,
# output/pkg and output/logs are all visible from Windows and survive
# `docker compose down`. Editing in VS Code on Windows edits these files
# directly. This satisfies "source remains outside container".
- .:/workspace:cached
# -- twitch-core, read-only ------------------------------------------
# The shared core library lives one level up at ../core. Mounted at
# /twitch-core, outside /workspace, so Docker never creates a
# root-owned mount point inside the repo. Mounted
# read-only: this container builds EVO Player against it, it doesn't
# modify it.
- ../core:/twitch-core:ro
# -- Build-id only: the repo's git metadata, laid out the same way as
# on the host ------------------------------------------------------
# /workspace above has no .git of its own - app/ is a git-subtree
# import, so the real .git lives one level up, outside that bind
# mount. package-app.sh's build-id step (`git rev-parse` / `git diff`
# for the short hash + dirty flag) needs it, so it is mounted here
# read-only together with a second, read-only view of this same
# directory nested under app/ - recreating ../ (.git next to app/) so
# GIT_DIR=/workspace-git/.git + GIT_WORK_TREE=/workspace-git resolve
# exactly like a plain `git -C app/projects/evoplayer ...` on the host.
- ../.git:/workspace-git/.git:ro
- .:/workspace-git/app:ro
# -- SDK lives in a named volume -------------------------------------
# Seeded from the image on first run. It is a volume rather than plain
# image content so that things you *add* to the sysroot at runtime
# persist across container restarts:
# * a custom FFmpeg installed by scripts/build-ffmpeg.sh
# * SCE stubs generated from your own decrypted SPRX files
# * extra pacbrew ports
# Delete it (docker volume rm ps5twitch_ps5_sdk) to get back to the
# pristine, image-pinned SDK.
- ps5_sdk:/opt/ps5-payload-sdk
# -- Heavy build trees stay OUT of the Windows filesystem -------------
# Bind mounts on Docker Desktop are slow for builds that create tens of
# thousands of small object files. FFmpeg's object tree and ccache live
# on native Linux volumes; only the *installed* artifacts are copied back
# into the bind-mounted sysroot/output.
- ffmpeg_build:/build/ffmpeg
- ccache:/ccache
# Nothing here needs elevated privileges.
privileged: false
# Uncomment ONLY if you run a service inside the container that the PS5 or
# your LAN must reach (e.g. serving a payload over HTTP to the console).
# ports:
# - "8080:8080"
# Docker Desktop resolves this to the Windows host if you ever need to
# reach something running on Windows itself.
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
ps5_sdk:
name: ps5twitch_ps5_sdk
ffmpeg_build:
name: ps5twitch_ffmpeg_build
ccache:
name: ps5twitch_ccache