This document provides a guide for creating a Docker-based build environment specifically for compiling the TIC-80 Pro version to be used in automated pipelines.
TIC-80 Pro is a commercial product that offers additional features and supports the ongoing development of the platform. The Pro version is available for purchase on itch.io.
While the TIC-80 source code is open, building the Pro version is intended for users who have purchased a license. If you have bought TIC-80 Pro, you are encouraged to use this Dockerfile to build your own Pro binary from source within a clean and isolated environment, ensuring consistency across your development and CI/CD workflows.
The provided Dockerfile automates the setup of the compilation environment and the build process itself. Below is a step-by-step breakdown of how it works:
FROM ubuntu:24.04
Sets the base image to Ubuntu 24.04 (Noble Numbat), providing a stable and modern Linux foundation for the build.
RUN apt-get update && apt-get install -y ...
Updates the package lists and installs all necessary development tools and libraries:
build-essential and cmake: Core tools for compiling C++ projects.git: Required to clone the source code repository.libsdl2-dev, libpipewire-0.3-dev, libwayland-dev, etc.: Libraries for graphics, audio, and system integration.ruby-dev, lua5.4, libcurl4-openssl-dev: Dependencies for scripting languages and networking features supported by TIC-80.rm -rf /var/lib/apt/lists/* to keep the image size small by removing temporary cache files.RUN git clone --recursive https://github.com/nesbox/TIC-80 /opt/TIC-80
Downloads the TIC-80 source code from GitHub into the /opt/TIC-80 directory, including all necessary submodules.
cd /opt/TIC-80/build && cmake ...
Enters the build directory and configures the project using CMake with specific flags:
-DBUILD_PRO=On: This is the crucial flag that enables the Pro features during compilation.-DBUILD_SDLGPU=On, -DBUILD_WITH_ALL=On: Enables all optional features and GPU support.-DBUILD_STATIC=On: Ensures that the resulting binary is statically linked, making it more portable across different Linux environments.cmake --build . --parallel
Starts the actual compilation process, utilizing multiple CPU cores to speed up the build.
ENV PATH="/opt/TIC-80/build/bin:${PATH}"
Adds the directory containing the newly built TIC-80 binary to the system's PATH, allowing you to run tic80 from anywhere inside the container.
WORKDIR /workspace
Sets the default working directory to /workspace, which is the intended location for mounting your project files.
CMD ["/bin/bash"]
Defines the default command to start a bash shell when the container is run, providing an interactive environment if needed.