Make docker image smaller
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful
This commit is contained in:
parent
24c6904423
commit
f35d23674e
2 changed files with 16 additions and 5 deletions
15
Dockerfile
15
Dockerfile
|
|
@ -1,4 +1,4 @@
|
||||||
FROM alpine:latest
|
FROM alpine:latest AS builder
|
||||||
|
|
||||||
ENV OPENTTD_JGR_VERSION=0.65.3
|
ENV OPENTTD_JGR_VERSION=0.65.3
|
||||||
|
|
||||||
|
|
@ -26,18 +26,29 @@ WORKDIR /openttd
|
||||||
|
|
||||||
RUN git clone --depth 1 --branch jgrpp-$OPENTTD_JGR_VERSION https://github.com/JGRennison/OpenTTD-patches.git source
|
RUN git clone --depth 1 --branch jgrpp-$OPENTTD_JGR_VERSION https://github.com/JGRennison/OpenTTD-patches.git source
|
||||||
|
|
||||||
# Build the source
|
|
||||||
WORKDIR /openttd/source
|
WORKDIR /openttd/source
|
||||||
RUN mkdir build && cd build && \
|
RUN mkdir build && cd build && \
|
||||||
cmake .. -DCMAKE_BUILD_TYPE=Release && \
|
cmake .. -DCMAKE_BUILD_TYPE=Release && \
|
||||||
make -j$(nproc)
|
make -j$(nproc)
|
||||||
|
|
||||||
|
FROM alpine:latest
|
||||||
|
|
||||||
WORKDIR /openttd
|
WORKDIR /openttd
|
||||||
|
|
||||||
|
COPY --from=builder /openttd/source/build /openttd
|
||||||
|
|
||||||
RUN mkdir -p /root/.openttd/baseset && \
|
RUN mkdir -p /root/.openttd/baseset && \
|
||||||
wget -q https://cdn.openttd.org/opengfx-releases/7.1/opengfx-7.1-all.zip && \
|
wget -q https://cdn.openttd.org/opengfx-releases/7.1/opengfx-7.1-all.zip && \
|
||||||
unzip opengfx-7.1-all.zip -d /root/.openttd/baseset && \
|
unzip opengfx-7.1-all.zip -d /root/.openttd/baseset && \
|
||||||
rm opengfx-7.1-all.zip
|
rm opengfx-7.1-all.zip
|
||||||
|
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
sdl2-dev \
|
||||||
|
fontconfig-dev \
|
||||||
|
icu-dev \
|
||||||
|
lzo-dev
|
||||||
|
|
||||||
COPY start.sh /start.sh
|
COPY start.sh /start.sh
|
||||||
RUN chmod +x /start.sh
|
RUN chmod +x /start.sh
|
||||||
|
|
||||||
CMD ["/start.sh"]
|
CMD ["/start.sh"]
|
||||||
|
|
|
||||||
6
start.sh
6
start.sh
|
|
@ -1,10 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
SAVE_FILE="/root/.openttd/save/autosave/latest.sav"
|
SAVE_FILE="/root/.openttd/save/autosave/latest.sav"
|
||||||
|
|
||||||
if [ -f "$SAVE_FILE" ]; then
|
if [ -f "$SAVE_FILE" ]; then
|
||||||
echo "Loading savegame: $SAVE_FILE"
|
echo "Loading savegame: $SAVE_FILE"
|
||||||
exec /openttd/source/build/openttd -D -g autosave/latest.sav
|
exec /openttd/openttd -D -g autosave/latest.sav
|
||||||
else
|
else
|
||||||
echo "No savegame found. Starting new game."
|
echo "No savegame found. Starting new game."
|
||||||
exec /openttd/source/build/openttd -D
|
exec /openttd/openttd -D
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue