-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.prebake
77 lines (62 loc) · 3.13 KB
/
Dockerfile.prebake
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
###########################################################
# Dockerfile that builds a stationeers Dedicated Gameserver
###########################################################
#
# This variant runs steamcmd to grab the latest updates, and saves these for later use
# (potentially so first boot of the server is quicker)
# VERY LARGE WARNING - THIS WILL OVERWRITE YOUR DEDICATED SERVER DIRECTORY!
# If the unfortunate occurs and the save directory gets packaged, this may be overwritten. Be warned!
# Building and Testing
# docker build . -f Dockerfile.prebake -t powareverb/stationeers-dedserver:prebake-latest
# With our expected build data
# docker build --build-arg EXPECTED_VERSION_PUBLIC_BUILDID=${VERSION_PUBLIC_BUILDID} --build-arg EXPECTED_VERSION_BETA_BUILDID=${VERSION_BETA_BUILDID} . -f Dockerfile.prebake -t powareverb/stationeers-dedserver:prebake-latest
# docker image ls | grep stationeers
# Run
# docker run --rm -it powareverb/stationeers-dedserver:prebake-latest /bin/bash
# docker run --rm powareverb/stationeers-dedserver:prebake-latest
# Beta
# docker run --rm -it powareverb/stationeers-dedserver:prebake-branch-beta-latest /bin/bash
# Permanent
# docker run --rm -it --net=host -v stationeers-data:/home/steam/stationeers-server-dedicated/ --name=stationeers-dedicated-host powareverb/stationeers-dedserver /bin/bash
# docker run -d --net=host -v stationeers-data:/home/steam/stationeers-server-dedicated/ --name=stationeers-dedicated-host powareverb/stationeers-dedserver
# Jump in
# docker exec -it stationeers-dedicated bash
# docker exec -it stationeers-dedicated-host bash
# Validate versions - in image
# echo "steam"; cat stationeers-server-prebake/steamapps/appmanifest_600760.acf | grep buildid
# echo "game"; cat stationeers-server-prebake/rocketstation_DedicatedServer_Data/StreamingAssets/version.ini | grep UPDATE
# Validate current game version externally
# docker cp 4a2ea3eaa18d:/home/steam/stationeers-server-prebake/rocketstation_DedicatedServer_Data/StreamingAssets/version.ini ./version.ini
# cat version.ini | grep UPDATE
# https://stationeers-wiki.com/Dedicated_Server_Guide
FROM powareverb/stationeers-dedserver:latest
LABEL maintainer="[email protected]"
ENV STEAMAPPID 600760
ENV STEAMAPP stationeers-server
ENV STEAMAPPDIR "${HOMEDIR}/${STEAMAPP}-dedicated"
ENV STEAMCMDDIR "${HOMEDIR}/steamcmd"
# The base image switches to user, we still need to make some changes
USER root
COPY ./entry.sh ${HOMEDIR}
RUN chmod a+x ./entry.sh
ENV PREBAKEDIR "${HOMEDIR}/${STEAMAPP}-prebake"
# Switch to user
USER ${USER}
VOLUME ${STEAMAPPDIR}
WORKDIR ${HOMEDIR}
# This will download the bits and bake them into the image
ARG EXPECTED_VERSION_PUBLIC_BUILDID="unknown"
ARG EXPECTED_VERSION_BETA_BUILDID="unknown"
ARG EXPECTED_VERSION_BRANCH "beta"
ENV VERSION_PUBLIC_BUILDID ${EXPECTED_VERSION_PUBLIC_BUILDID}
ENV VERSION_BETA_BUILDID ${EXPECTED_VERSION_BETA_BUILDID}
ENV VERSION_BRANCH ${EXPECTED_VERSION_BRANCH}
RUN export PREBAKE=true && export STEAMAPPDIR=${PREBAKEDIR} && ./entry.sh
CMD ["bash", "entry.sh"]
# 27500
# Expose ports
EXPOSE 27015/tcp \
27015/udp \
27020/udp
# Required for stationeers server
EXPOSE 27500/udp 27501/udp