-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
89affb3
commit 86af30a
Showing
2 changed files
with
56 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,50 @@ | ||
FROM debian:bookworm | ||
FROM arm64v8/debian:bookworm-slim | ||
LABEL com.docker.image.architecture=arm64 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV USER steam | ||
ENV STEAMCMDDIR "/opt/steamcmd" | ||
ENV LD_LIBRARY_PATH "${LD_LIBRARY_PATH}:/usr/lib/box64-x86_64-linux-gnu" | ||
|
||
# Install dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
wget \ | ||
curl \ | ||
gpg \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
wget \ | ||
curl \ | ||
gpg \ | ||
ca-certificates \ | ||
libcurl4 \ | ||
libc6 \ | ||
libstdc++6 \ | ||
lib32gcc-s1 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install box64 | ||
RUN wget https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \ | ||
&& wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg \ | ||
&& apt-get update && apt-get install -y box64 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
&& wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg \ | ||
&& apt-get update && apt-get install -y box64-rpi5arm64 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Setup steamcmd | ||
RUN mkdir -p /opt/steamcmd | ||
WORKDIR /opt/steamcmd | ||
RUN curl -sSL -o steamcmd.tar.gz https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz \ | ||
&& tar -xzvf steamcmd.tar.gz \ | ||
&& rm steamcmd.tar.gz | ||
RUN useradd -m ${USER} \ | ||
&& mkdir -p ${STEAMCMDDIR} \ | ||
&& chown -R ${USER}:${USER} ${STEAMCMDDIR} | ||
|
||
WORKDIR ${STEAMCMDDIR} | ||
|
||
# Install SteamCMD as steam user | ||
USER ${USER} | ||
RUN curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf - \ | ||
&& mkdir -p ~/.steam/sdk64 \ | ||
&& mkdir -p ${STEAMCMDDIR}/linux64 | ||
|
||
USER root | ||
RUN mkdir -p /opt/unturned-config \ | ||
&& mkdir -p /opt/U3DS | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
RUN mkdir -p /opt/unturned-config | ||
COPY start.sh /opt/unturned-config/start.sh | ||
RUN chmod +x /opt/unturned-config/start.sh | ||
RUN chmod +x /entrypoint.sh /opt/unturned-config/start.sh \ | ||
&& chown -R ${USER}:${USER} /opt/U3DS /opt/unturned-config | ||
|
||
USER ${USER} | ||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,37 @@ | ||
#!/bin/bash | ||
cd /opt/steamcmd | ||
set -e | ||
|
||
cd ${STEAMCMDDIR} | ||
|
||
# Initialize SteamCMD | ||
./steamcmd.sh +quit | ||
|
||
# Install/Update Unturned Dedicated Server | ||
if [ -f /opt/U3DS/.validate ]; then | ||
rm /opt/U3DS/.validate | ||
./steamcmd.sh +force_install_dir /opt/U3DS +login anonymous +app_update 1110390 validate +quit | ||
rm /opt/U3DS/.validate | ||
box64 ${STEAMCMDDIR}/steamcmd.sh +force_install_dir /opt/U3DS +login anonymous +app_update 1110390 validate +quit | ||
else | ||
./steamcmd.sh +force_install_dir /opt/U3DS +login anonymous +app_update 1110390 +quit | ||
box64 ${STEAMCMDDIR}/steamcmd.sh +force_install_dir /opt/U3DS +login anonymous +app_update 1110390 +quit | ||
fi | ||
|
||
if [ -f /opt/U3DS/.vanilla ]; then | ||
rm -rf /opt/U3DS/Modules/Rocket.Unturned | ||
else | ||
cp -r /opt/U3DS/Extras/Rocket.Unturned /opt/U3DS/Modules/Rocket.Unturned | ||
# Setup Rocket mod if not vanilla | ||
if [ ! -f /opt/U3DS/.vanilla ] && [ -d /opt/U3DS/Extras/Rocket.Unturned ]; then | ||
mkdir -p /opt/U3DS/Modules | ||
cp -r /opt/U3DS/Extras/Rocket.Unturned /opt/U3DS/Modules/ | ||
fi | ||
|
||
# Setup Steam client | ||
mkdir -p /opt/U3DS/.steam/sdk64 | ||
cp linux64/steamclient.so /opt/U3DS/.steam/sdk64/ | ||
cp ${STEAMCMDDIR}/linux64/steamclient.so /opt/U3DS/.steam/sdk64/ | ||
cd /opt/U3DS | ||
mkdir -p Unturned_Headless_Data/Plugins/x86_64/ | ||
ln -sf ../.steam/sdk64/steamclient.so Unturned_Headless_Data/Plugins/x86_64/steamclient.so | ||
|
||
# Copy start script if not exists | ||
if [ ! -f start.sh ]; then | ||
cp /opt/unturned-config/start.sh ./start.sh | ||
chmod +x start.sh | ||
fi | ||
|
||
export LD_LIBRARY_PATH="./Unturned_Headless_Data/Plugins/x86_64/" | ||
export LD_LIBRARY_PATH="./Unturned_Headless_Data/Plugins/x86_64/:${LD_LIBRARY_PATH}" | ||
exec box64 ./start.sh |