Add Onbuild Basedir Argument

Reduce Cache Layers
Remove Volumes
Fix Ports
Fix exec config
This commit is contained in:
Lars Olzem 2017-01-17 21:14:57 +01:00
parent 77376de844
commit c6900fb0d8
12 changed files with 76 additions and 64 deletions

View File

@ -1,48 +1,44 @@
FROM hackebein/steamcmd:latest
ARG BASEDIR=/opt/garrysmod
ONBUILD ARG BASEDIR=$BASEDIR
ENV BASEDIR=$BASEDIR \
PORT="27015" \
TICKRATE="66" \
WORKSHOPCOLLECTIONID="" \
MAXPLAYERS="16" \
#http://steamcommunity.com/dev/apikey
AUTHKEY="" \
WORKSHOPCOLLECTIONID="" \
CLIENTPORT="27005" \
# sandbox or terrortown
GAMEMODE="sandbox" \
MAP="gm_flatgrass" \
#http://steamcommunity.com/dev/managegameservers APPID: 4000
GLST="" \
CONFIG="server.cfg" \
MAXPLAYERS="16" \
LOADURLIMG="http://www.pixelstalk.net/wp-content/uploads/2016/03/Cracked-Screen-Background-cute.jpg" \
LOADURL="data:text/html, <style>html, body{ padding:0;margin:0;background:#000 }</style><img src='${LOADURLIMG}' width='100%' height='100%'>" \
CUSTOMPARAMETERS=""
RUN apt-get update -q && \
apt-get install -yqq lib32tinfo5 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN /usr/games/steamcmd \
+login anonymous \
+force_install_dir $BASEDIR \
# cstrike
+app_update 232330 -validate -language en \
# garrysmod
+app_update 4020 -validate -language en \
+quit && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
/usr/games/steamcmd \
+login anonymous \
+force_install_dir $BASEDIR \
# cstrike
+app_update 232330 -validate -language en \
# garrysmod
+app_update 4020 -validate -language en \
+quit && \
rm -rf $BASEDIR/garrysmod/cfg/*
COPY cfg $BASEDIR/garrysmod/cfg
VOLUME [ "$BASEDIR/garrysmod/volume" ]
WORKDIR $BASEDIR
EXPOSE 27015/udp 27015/tcp
EXPOSE 27015/udp
ENTRYPOINT []
CMD [ \
"sh", \
"-c", \
@ -51,14 +47,13 @@ CMD [ \
-strictportbind \
-port ${PORT} \
-tickrate ${TICKRATE} \
+host_workshop_collection ${WORKSHOPCOLLECTIONID} \
-maxplayers ${MAXPLAYERS} \
-authkey ${AUTHKEY} \
+host_workshop_collection ${WORKSHOPCOLLECTIONID} \
+clientport ${CLIENTPORT} \
+gamemode ${GAMEMODE} \
+map ${MAP} \
+sv_setsteamaccount ${GLST} \
+servercfgfile ${CONFIG} \
-maxplayers ${MAXPLAYERS} \
+sv_loadingurl ${LOADURL} \
${CUSTOMPARAMETERS}" \
]

4
latest/cfg/sandbox.cfg Normal file
View File

@ -0,0 +1,4 @@
// Garry's Mod - sandbox - Config
// https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/sandbox/sandbox.txt
exec server.cfg
exec my.sandbox.cfg

View File

@ -1,2 +1,3 @@
// Garry's Mod - Config
exec ../volume/server.cfg
// https://developer.valvesoftware.com/wiki/Console_Command_List
exec my.server.cfg

View File

@ -0,0 +1,4 @@
// Garry's Mod - terrortown - Config
// https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/terrortown/terrortown.txt
exec server.cfg
exec my.terrortown.cfg

View File

@ -1,46 +1,42 @@
FROM hackebein/steamcmd:latest
ARG BASEDIR=/opt/garrysmod
ONBUILD ARG BASEDIR=$BASEDIR
ENV BASEDIR=$BASEDIR \
PORT="27015" \
TICKRATE="66" \
WORKSHOPCOLLECTIONID="" \
MAXPLAYERS="16" \
#http://steamcommunity.com/dev/apikey
AUTHKEY="" \
WORKSHOPCOLLECTIONID="" \
CLIENTPORT="27005" \
# sandbox or terrortown
GAMEMODE="sandbox" \
MAP="gm_flatgrass" \
#http://steamcommunity.com/dev/managegameservers APPID: 4000
GLST="" \
CONFIG="server.cfg" \
MAXPLAYERS="16" \
LOADURLIMG="http://www.pixelstalk.net/wp-content/uploads/2016/03/Cracked-Screen-Background-cute.jpg" \
LOADURL="data:text/html, <style>html, body{ padding:0;margin:0;background:#000 }</style><img src='${LOADURLIMG}' width='100%' height='100%'>" \
CUSTOMPARAMETERS=""
RUN apt-get update -q && \
apt-get install -yqq lib32tinfo5 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN /usr/games/steamcmd \
+login anonymous \
+force_install_dir $BASEDIR \
# garrysmod
+app_update 4020 -validate -language en \
+quit && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
/usr/games/steamcmd \
+login anonymous \
+force_install_dir $BASEDIR \
# garrysmod
+app_update 4020 -validate -language en \
+quit && \
rm -rf $BASEDIR/garrysmod/cfg/*
COPY cfg $BASEDIR/garrysmod/cfg
VOLUME [ "$BASEDIR/garrysmod/volume" ]
WORKDIR $BASEDIR
EXPOSE 27015/udp 27015/tcp
EXPOSE 27015/udp
ENTRYPOINT []
CMD [ \
"sh", \
"-c", \
@ -49,14 +45,13 @@ CMD [ \
-strictportbind \
-port ${PORT} \
-tickrate ${TICKRATE} \
+host_workshop_collection ${WORKSHOPCOLLECTIONID} \
-maxplayers ${MAXPLAYERS} \
-authkey ${AUTHKEY} \
+host_workshop_collection ${WORKSHOPCOLLECTIONID} \
+clientport ${CLIENTPORT} \
+gamemode ${GAMEMODE} \
+map ${MAP} \
+sv_setsteamaccount ${GLST} \
+servercfgfile ${CONFIG} \
-maxplayers ${MAXPLAYERS} \
+sv_loadingurl ${LOADURL} \
${CUSTOMPARAMETERS}" \
]

4
minimal/cfg/sandbox.cfg Normal file
View File

@ -0,0 +1,4 @@
// Garry's Mod - sandbox - Config
// https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/sandbox/sandbox.txt
exec server.cfg
exec my.sandbox.cfg

View File

@ -1,2 +1,3 @@
// Garry's Mod - Config
exec ../volume/server.cfg
// https://developer.valvesoftware.com/wiki/Console_Command_List
exec my.server.cfg

View File

@ -0,0 +1,4 @@
// Garry's Mod - terrortown - Config
// https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/terrortown/terrortown.txt
exec server.cfg
exec my.terrortown.cfg

View File

@ -1,48 +1,44 @@
FROM hackebein/steamcmd:latest
ARG BASEDIR=/opt/garrysmod
ONBUILD ARG BASEDIR=$BASEDIR
ENV BASEDIR=$BASEDIR \
PORT="27015" \
TICKRATE="66" \
WORKSHOPCOLLECTIONID="" \
MAXPLAYERS="16" \
#http://steamcommunity.com/dev/apikey
AUTHKEY="" \
WORKSHOPCOLLECTIONID="" \
CLIENTPORT="27005" \
# sandbox or terrortown
GAMEMODE="sandbox" \
MAP="gm_flatgrass" \
#http://steamcommunity.com/dev/managegameservers APPID: 4000
GLST="" \
CONFIG="server.cfg" \
MAXPLAYERS="16" \
LOADURLIMG="http://www.pixelstalk.net/wp-content/uploads/2016/03/Cracked-Screen-Background-cute.jpg" \
LOADURL="data:text/html, <style>html, body{ padding:0;margin:0;background:#000 }</style><img src='${LOADURLIMG}' width='100%' height='100%'>" \
CUSTOMPARAMETERS=""
RUN apt-get update -q && \
apt-get install -yqq lib32tinfo5 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN /usr/games/steamcmd \
+login anonymous \
+force_install_dir $BASEDIR \
# cstrike
+app_update 232330 -validate -language en \
# garrysmod
+app_update 4020 -validate -language en \
+quit && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
/usr/games/steamcmd \
+login anonymous \
+force_install_dir $BASEDIR \
# cstrike
+app_update 232330 -validate -language en \
# garrysmod
+app_update 4020 -validate -language en \
+quit && \
rm -rf $BASEDIR/garrysmod/cfg/*
COPY cfg $BASEDIR/garrysmod/cfg
VOLUME [ "$BASEDIR/garrysmod/volume" ]
WORKDIR $BASEDIR
EXPOSE 27015/udp 27015/tcp
EXPOSE 27015/udp
ENTRYPOINT []
CMD [ \
"sh", \
"-c", \
@ -51,14 +47,13 @@ CMD [ \
-strictportbind \
-port ${PORT} \
-tickrate ${TICKRATE} \
+host_workshop_collection ${WORKSHOPCOLLECTIONID} \
-maxplayers ${MAXPLAYERS} \
-authkey ${AUTHKEY} \
+host_workshop_collection ${WORKSHOPCOLLECTIONID} \
+clientport ${CLIENTPORT} \
+gamemode ${GAMEMODE} \
+map ${MAP} \
+sv_setsteamaccount ${GLST} \
+servercfgfile ${CONFIG} \
-maxplayers ${MAXPLAYERS} \
+sv_loadingurl ${LOADURL} \
${CUSTOMPARAMETERS}" \
]

View File

@ -0,0 +1,4 @@
// Garry's Mod - sandbox - Config
// https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/sandbox/sandbox.txt
exec server.cfg
exec my.sandbox.cfg

View File

@ -1,2 +1,3 @@
// Garry's Mod - Config
exec ../volume/server.cfg
// https://developer.valvesoftware.com/wiki/Console_Command_List
exec my.server.cfg

View File

@ -0,0 +1,4 @@
// Garry's Mod - terrortown - Config
// https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/terrortown/terrortown.txt
exec server.cfg
exec my.terrortown.cfg