Update Dockerfile
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
sora 2023-11-17 22:19:21 +01:00
parent 4dd09362ac
commit 848218fd72

View File

@ -1,75 +1,75 @@
FROM debian:stable as builder FROM debian:stable as builder
WORKDIR /tmp WORKDIR /tmp
ENV jgrpp_version=0.53.3 ENV jgrpp_version=0.55.3
ENV opengfx_version=7.1 ENV opengfx_version=7.1
RUN apt-get update RUN apt-get update
RUN apt-get upgrade -y RUN apt-get upgrade -y
RUN apt-get install -y \ RUN apt-get install -y \
cmake \ cmake \
curl \ curl \
unzip \ unzip \
xz-utils \ xz-utils \
build-essential \ build-essential \
ninja-build \ ninja-build \
pkg-config \ pkg-config \
zlib1g \ zlib1g \
zlib1g-dev \ zlib1g-dev \
liblzma5 \ liblzma5 \
liblzma-dev \ liblzma-dev \
liblzo2-2 \ liblzo2-2 \
liblzo2-dev \ liblzo2-dev \
libzstd-dev \ libzstd-dev \
libpng16-16 \ libpng16-16 \
libpng-dev libpng-dev
RUN curl -fLo jgrpp-$jgrpp_version.tar.gz https://github.com/JGRennison/OpenTTD-patches/archive/jgrpp-$jgrpp_version.tar.gz 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 curl -fLo opengfx-$opengfx_version-all.zip https://cdn.openttd.org/opengfx-releases/$opengfx_version/opengfx-$opengfx_version-all.zip
RUN tar -xvzf jgrpp-$jgrpp_version.tar.gz RUN tar -xvzf jgrpp-$jgrpp_version.tar.gz
RUN mkdir /tmp/build RUN mkdir /tmp/build
WORKDIR /tmp/build WORKDIR /tmp/build
RUN cmake \ RUN cmake \
-B build \ -B build \
-D CMAKE_BUILD_TYPE=Release \ -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=/usr \ -D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_INSTALL_BINDIR=bin \ -D CMAKE_INSTALL_BINDIR=bin \
-D CMAKE_INSTALL_DATADIR=/usr/share \ -D CMAKE_INSTALL_DATADIR=/usr/share \
-D OPTION_DEDICATED=ON \ -D OPTION_DEDICATED=ON \
-D DEFAULT_PERSONAL_DIR=/data \ -D DEFAULT_PERSONAL_DIR=/data \
-G Ninja \ -G Ninja \
-S /tmp/OpenTTD-patches-jgrpp-$jgrpp_version -S /tmp/OpenTTD-patches-jgrpp-$jgrpp_version
RUN ninja -C build RUN ninja -C build
RUN ninja -C build install RUN ninja -C build install
WORKDIR /tmp WORKDIR /tmp
RUN unzip opengfx-$opengfx_version-all.zip RUN unzip opengfx-$opengfx_version-all.zip
RUN mv opengfx-$opengfx_version.tar /usr/share/openttd/baseset/opengfx-$opengfx_version.tar RUN mv opengfx-$opengfx_version.tar /usr/share/openttd/baseset/opengfx-$opengfx_version.tar
FROM debian:stable FROM debian:stable
RUN apt-get update \ RUN apt-get update \
&& apt-get upgrade -y \ && apt-get upgrade -y \
&& apt-get install -y \ && apt-get install -y \
zlib1g \ zlib1g \
liblzma5 \ liblzma5 \
liblzo2-2 \ liblzo2-2 \
libzstd1 \ libzstd1 \
libpng16-16 \ libpng16-16 \
nano \ nano \
&& apt-get clean \ && apt-get clean \
&& rm -rvf /var/lib/apt/lists/* /var/log/apt /var/log/dpkg.log && 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/bin/openttd /usr/bin/openttd
COPY --from=builder /usr/share/openttd/ /usr/share/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/doc/openttd/ /usr/share/doc/openttd/
COPY --from=builder /usr/share/man/man6/openttd.6.gz /usr/share/man/man6/openttd.6.gz 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 RUN useradd -ms /bin/sh -d /data openttd
USER openttd:openttd USER openttd:openttd
EXPOSE 3979 EXPOSE 3979
EXPOSE 3979/udp EXPOSE 3979/udp
WORKDIR /data WORKDIR /data
ENV XDG_DATA_HOME=/data ENV XDG_DATA_HOME=/data
ENTRYPOINT ["/usr/bin/openttd", "-D"] ENTRYPOINT ["/usr/bin/openttd", "-D"]
#, "-g", "map.sav"] #, "-g", "map.sav"]