Files
archived-shadPS4/documents/building-docker.md
Berk 514e363472 Add Docker build support and documentation (#3960)
* Docker builder support

* update licenses

* oops I forgot change this description
2026-01-27 10:09:32 +02:00

2.2 KiB
Raw Blame History

Building shadPS4 with Docker and VSCode Support

This guide explains how to build shadPS4 using Docker while keeping full compatibility with VSCode development.


Prerequisites

Before starting, ensure you have:

  • Docker Engine or Docker Desktop installed
    Installation Guide

  • Git installed on your system.


Step 1: Prepare the Docker Environment

Inside the container (or on your host if mounting volumes):

  1. Navigate to the repository folder containing the Docker Builder folder:
cd <path-to-repo>
  1. Start the Docker container:
docker compose up -d

This will spin up a container with all the necessary build dependencies, including Clang, CMake, SDL2, Vulkan, and more.

Step 2: Clone shadPS4 Source

mkdir emu
cd emu
git clone --recursive https://github.com/shadps4-emu/shadPS4.git .

or your fork link.
  1. Initialize submodules:
git submodule update --init --recursive

Step 3: Build with CMake

Generate the build directory and configure the project using Clang:

cmake -S . -B build/ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++

Then build the project:

cmake --build ./build --parallel $(nproc)
  • Tip: To enable debug builds, add -DCMAKE_BUILD_TYPE=Debug to the CMake command.

After a successful build, the executable is located at:

./build/shadps4

Step 4: VSCode Integration

  1. Open the repository in VSCode.
  2. The CMake Tools extension should automatically detect the build directory inside the container or on your host.
  3. You can configure build options, build, and debug directly from the VSCode interface without extra manual setup.

Notes

  • The Docker environment contains all dependencies, so you dont need to install anything manually.
  • Using Clang inside Docker ensures consistent builds across Linux and macOS runners.
  • GitHub Actions are recommended for cross-platform builds, including Windows .exe output, which is not trivial to produce locally without Visual Studio or clang-cl.