forked from escapingnetwork/core-keeper-dedicated
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
92 lines (78 loc) · 3.6 KB
/
Dockerfile
File metadata and controls
92 lines (78 loc) · 3.6 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
############################################################
# Dockerfile that contains SteamCMD
############################################################
FROM debian:bookworm-slim as build_stage
ENV HOMEDIR "/opt/core-keeper"
ENV STEAMCMDDIR "${HOMEDIR}/steamcmd"
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
lib32stdc++6=12.2.0-14 \
lib32gcc-s1=12.2.0-14 \
ca-certificates=20230311 \
nano=7.2-1+deb12u1 \
curl=7.88.1-10+deb12u7 \
locales=2.36-9+deb12u7 \
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \
# Download SteamCMD
&& mkdir -p "${STEAMCMDDIR}" \
&& curl -fsSL 'https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz' | tar xvzf - -C "${STEAMCMDDIR}" \
&& "./${STEAMCMDDIR}/steamcmd.sh" +quit \
&& ln -s "${STEAMCMDDIR}/linux32/steamclient.so" "${STEAMCMDDIR}/steamservice.so" \
&& mkdir -p "${HOMEDIR}/.steam/sdk32" \
&& ln -s "${STEAMCMDDIR}/linux32/steamclient.so" "${HOMEDIR}/.steam/sdk32/steamclient.so" \
&& ln -s "${STEAMCMDDIR}/linux32/steamcmd" "${STEAMCMDDIR}/linux32/steam" \
&& mkdir -p "${HOMEDIR}/.steam/sdk64" \
&& ln -s "${STEAMCMDDIR}/linux64/steamclient.so" "${HOMEDIR}/.steam/sdk64/steamclient.so" \
&& ln -s "${STEAMCMDDIR}/linux64/steamcmd" "${STEAMCMDDIR}/linux64/steam" \
&& ln -s "${STEAMCMDDIR}/steamcmd.sh" "${STEAMCMDDIR}/steam.sh" \
# Symlink steamclient.so; So misconfigured dedicated servers can find it
&& ln -s "${STEAMCMDDIR}/linux64/steamclient.so" "/usr/lib/x86_64-linux-gnu/steamclient.so" \
&& rm -rf /var/lib/apt/lists/*
###########################################################
# Dockerfile that builds a Core Keeper Gameserver
###########################################################
FROM build_stage
WORKDIR ${STEAMCMDDIR}
ENV STEAMAPPID 1007
ENV STEAMAPPID_TOOL 1963720
ENV STEAMAPP core-keeper
ENV STEAMAPPDIR "${HOMEDIR}/server"
ENV STEAMAPPDATADIR "${HOMEDIR}/data"
ENV DLURL https://raw.githubusercontent.com/escapingnetwork/core-keeper-dedicated
COPY ./entry.sh ${HOMEDIR}/entry.sh
COPY ./launch.sh ${HOMEDIR}/launch.sh
RUN dpkg --add-architecture i386
# Install Core Keeper server dependencies and clean up
# libx32gcc-s1 lib32gcc-s1 build-essential <- fixes tile generation bug (obsidian wall around spawn) without graphic cards mounted to server
# need all 3 + dpkg i do not know why but every other combination would run the server at an extreme speed - that combination worked for me.
# Thanks to https://www.reddit.com/r/CoreKeeperGame/comments/uym86p/comment/iays04w/?utm_source=share&utm_medium=web2x&context=3
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
xvfb mesa-utils libx32gcc-s1 lib32gcc-s1 build-essential libxi6 x11-utils tini \
&& mkdir -p "${STEAMAPPDIR}" \
&& mkdir -p "${STEAMAPPDATADIR}" \
&& chmod +x "${HOMEDIR}/entry.sh" \
&& chmod +x "${HOMEDIR}/launch.sh" \
&& chown -R "root:root" "${HOMEDIR}/entry.sh" "${HOMEDIR}/launch.sh" "${STEAMAPPDIR}" "${STEAMAPPDATADIR}" \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /tmp/.X11-unix
ENV WORLD_INDEX=0 \
WORLD_NAME="Core Keeper Server" \
WORLD_SEED=0 \
WORLD_MODE=0 \
GAME_ID="" \
DATA_PATH="${STEAMAPPDATADIR}" \
MAX_PLAYERS=10 \
SEASON=-1 \
SERVER_IP="" \
SERVER_PORT=""
# Switch to workdir
WORKDIR ${HOMEDIR}
VOLUME ${STEAMAPPDIR}
# Use tini as the entrypoint for signal handling
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["bash", "entry.sh"]