Files
openttd-client/docker/Dockerfile
T
kovagoadi 28f247799e
Continuous Integration / lint-and-security (push) Successful in 19s
Continuous Integration / tests-and-coverage (push) Successful in 24s
Merge pull request 'Update debian:trixie-slim Docker digest to d7e1218' (#26) from renovate/debian-trixie-slim into main
Reviewed-on: #26
2026-08-26 21:08:13 +02:00

64 lines
1.8 KiB
Docker

# Build stage
FROM debian:13@sha256:f324c7ff54321e8d9c588493a20244965938ce0aa50bbd1022d38010e9ffc4b1 AS builder
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
libcurl4-gnutls-dev \
liblzma-dev \
liblzo2-dev \
libpng-dev \
libzstd-dev \
zlib1g-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY OpenTTD-patches /src/OpenTTD-patches
WORKDIR /src/OpenTTD-patches/build
RUN cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DOPTION_DEDICATED=ON \
-DOPTION_INSTALL_HTML_DOCS=OFF \
-DOPTION_USE_ASSERTS=OFF \
&& make -j$(nproc) install
# Runtime stage
# Must track the builder's Debian release: the builder (debian:13/trixie) links
# against glibc 2.38+, so an older runtime (e.g. bookworm, glibc 2.36) cannot run
# the resulting binary. Package names use the trixie t64 spelling.
FROM debian:trixie-slim@sha256:d7e12182ce18b85b93007c1dedf31f2d29e01ccf3182cc4017c709b6259bc132
RUN apt-get update && apt-get install -y \
libcurl3t64-gnutls \
liblzma5 \
liblzo2-2 \
libpng16-16t64 \
libzstd1 \
zlib1g \
ca-certificates \
openttd-opengfx \
&& rm -rf /var/lib/apt/lists/*
# Copy binaries from builder
COPY --from=builder /usr/local/games/openttd /usr/local/bin/openttd
COPY --from=builder /usr/local/share/games/openttd /usr/local/share/games/openttd
# Ensure base graphics are in a path openttd searches
RUN mkdir -p /usr/local/share/games/openttd/baseset && \
cp -r /usr/share/games/openttd/baseset/* /usr/local/share/games/openttd/baseset/
# Create openttd user
RUN useradd -m -u 1000 openttd
USER openttd
WORKDIR /home/openttd
# Create config directory
RUN mkdir -p /home/openttd/.local/share/openttd/save
EXPOSE 3979/tcp 3979/udp 3977/tcp
CMD ["openttd", "-D"]