-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
72 lines (69 loc) · 2.22 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM debian:bookworm as builder
WORKDIR /tmp
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y \
cmake \
curl \
unzip \
xz-utils \
build-essential \
ninja-build \
pkg-config \
zlib1g \
zlib1g-dev \
liblzma5 \
liblzma-dev \
liblzo2-2 \
liblzo2-dev \
libzstd-dev \
libpng16-16 \
libpng-dev
ENV jgrpp_version=0.63.3
ENV opengfx_version=7.1
RUN curl -fLo jgrpp-$jgrpp_version.tar.gz https://github.com/JGRennison/OpenTTD-patches/archive/jgrpp-$jgrpp_version.tar.gz
RUN curl -fLo opengfx-$opengfx_version-all.zip https://cdn.openttd.org/opengfx-releases/$opengfx_version/opengfx-$opengfx_version-all.zip
RUN echo "93ae759eefc4bf3844244bdf0c381c5d8c5fde64c2305eb1243283a71882ab72 *jgrpp-$jgrpp_version.tar.gz" | sha256sum -c
RUN echo "928fcf34efd0719a3560cbab6821d71ce686b6315e8825360fba87a7a94d7846 *opengfx-$opengfx_version-all.zip" | sha256sum -c
RUN tar -xvzf jgrpp-$jgrpp_version.tar.gz
RUN mkdir /tmp/build
WORKDIR /tmp/build
RUN cmake \
-B build \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_INSTALL_BINDIR=bin \
-D CMAKE_INSTALL_DATADIR=/usr/share \
-D OPTION_DEDICATED=ON \
-D DEFAULT_PERSONAL_DIR=/data \
-G Ninja \
-S /tmp/OpenTTD-patches-jgrpp-$jgrpp_version
RUN ninja -C build
RUN ninja -C build install
WORKDIR /tmp
RUN unzip opengfx-$opengfx_version-all.zip
RUN mv opengfx-$opengfx_version.tar /usr/share/openttd/baseset/opengfx-$opengfx_version.tar
FROM debian:bookworm
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
zlib1g \
liblzma5 \
liblzo2-2 \
libzstd1 \
libpng16-16 \
&& apt-get clean \
&& rm -rvf /var/lib/apt/lists/* /var/log/apt /var/log/dpkg.log
COPY --from=builder /usr/bin/openttd /usr/bin/openttd
COPY --from=builder /usr/share/openttd/ /usr/share/openttd/
COPY --from=builder /usr/share/doc/openttd/ /usr/share/doc/openttd/
COPY --from=builder /usr/share/man/man6/openttd.6.gz /usr/share/man/man6/openttd.6.gz
RUN useradd -ms /bin/sh -d /data openttd
USER openttd:openttd
EXPOSE 3979
EXPOSE 3979/udp
WORKDIR /data
ENV XDG_DATA_HOME=/data
ENV XDG_CONFIG_HOME=/data
VOLUME ["/data"]
ENTRYPOINT ["/usr/bin/openttd"]