diff --git a/README.md b/README.md new file mode 100644 index 0000000..d5739ec --- /dev/null +++ b/README.md @@ -0,0 +1,71 @@ +# Supported tags and respective `Dockerfile` links + +* `minimal` [(minimal/Dockerfile)](https://github.com/Hackebein/docker-garrysmod/blob/master/minimal/Dockerfile) +* `latest` [(latest/Dockerfile)](https://github.com/Hackebein/docker-garrysmod/blob/master/latest/Dockerfile) +* ~~`full` [(full/Dockerfile)](https://github.com/Hackebein/docker-garrysmod/blob/master/full/Dockerfile).~~ coming soon + +# What is Garry's Mod? + +Garry's Mod is a physics sandbox. There aren't any predefined aims or goals. We give you the tools and leave you to play. + +# Update Hooks + +* on base image update (supported by Docker Hub) +* on repository update (supported by Docker Hub) +* ~~on steam repository content update (supported by [Huginn](https://github.com/Hackebein/docker-garrysmod/blob/master/huginn.json))~~ coming soon + +# Quick Start + +## Basic + +docker run --expose 27015 hackebein/garrysmod + +## Public + +docker run --expose 27015 -e "GLST=..." hackebein/garrysmod + +Get your [GLST](http://steamcommunity.com/dev/managegameservers) (`APPID: 4000`) + +## Public with Workshop Collection + +docker run --expose 27015 -e "GLST=..." -e "AUTHKEY=..." -e "WORKSHOPCOLLECTIONID=..." hackebein/garrysmod + +Get your [AUTHKEY](http://steamcommunity.com/dev/apikey) + +## Config + +docker run --expose 27015 -e "GLST=..." -e "AUTHKEY=..." -e "WORKSHOPCOLLECTIONID=..." --volume ./mycfg:/opt/garrysmod/garrysmod/volume hackebein/garrysmod + +Autoload `server.cfg` from volume. + +## Additional Environment + +PORT: Connection Port +(`Default: 27015`) + +TICKRATE: Tickrate of server, **Attention:** Change not recommended +(`Default: 66`) + +CLIENTPORT: +(`Default: 27005`) + +GAMEMODE: +(`Default: sandbox`) + +MAP: Map on Server start +(`Default: gm_flatgrass`) + +CONFIG: Server config, **Attention:** Change not recommended +(`Default: server.cfg`) + +MAXPLAYERS: Max players +(`Default: 16`) + +LOADURLIMG: URL for LOADURL default +(`Default: <URL>`) + +LOADURL: Loading screen URL +(`Default: <LOADURLIMG Fullscreen>`) + +CUSTOMPARAMETERS: additional parameters +(`Default: `) \ No newline at end of file diff --git a/latest/Dockerfile b/latest/Dockerfile new file mode 100644 index 0000000..0547ec5 --- /dev/null +++ b/latest/Dockerfile @@ -0,0 +1,16 @@ +FROM hackebein/garrysmod:minimal +MAINTAINER Lars Olzem <hackebein@gmail.com> + +ARG BASEDIR=/opt/garrysmod + +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 $BASEDIR/garrysmod/cfg/* + +COPY cfg $BASEDIR/garrysmod/cfg \ No newline at end of file diff --git a/latest/cfg/mount.cfg b/latest/cfg/mount.cfg new file mode 100644 index 0000000..b1b19cd --- /dev/null +++ b/latest/cfg/mount.cfg @@ -0,0 +1,19 @@ + +// +// Use this file to mount additional paths to the filesystem +// DO NOT add a slash to the end of the filename +// + +"mountcfg" +{ + "cstrike" "cstrike" + //"hl1" "" + //"hl1_hd" "" + //"hl2" "" + //"hl2mp" "" + //"episodic" "" + //"ep2" "" + //"lostcoast" "" +} + + diff --git a/latest/cfg/mountdepots.txt b/latest/cfg/mountdepots.txt new file mode 100644 index 0000000..4f93ee6 --- /dev/null +++ b/latest/cfg/mountdepots.txt @@ -0,0 +1,11 @@ +"gamedepotsystem" +{ + "cstrike" "1" + //"hl1" "1" + //"hl1_hd" "1" + //"hl2" "1" + //"hl2mp" "1" + //"episodic" "1" + //"ep2" "1" + //"lostcoast" "1" +} \ No newline at end of file diff --git a/latest/cfg/server.cfg b/latest/cfg/server.cfg new file mode 100644 index 0000000..e5b2ac9 --- /dev/null +++ b/latest/cfg/server.cfg @@ -0,0 +1,2 @@ +// Garry's Mod - Config +exec ../volume/server.cfg \ No newline at end of file diff --git a/minimal/Dockerfile b/minimal/Dockerfile new file mode 100644 index 0000000..9737c02 --- /dev/null +++ b/minimal/Dockerfile @@ -0,0 +1,62 @@ +FROM hackebein/steamcmd:latest +MAINTAINER Lars Olzem <hackebein@gmail.com> + +ARG BASEDIR=/opt/garrysmod + +ENV PORT="27015" \ + TICKRATE="66" \ + WORKSHOPCOLLECTIONID="" \ + #http://steamcommunity.com/dev/apikey + AUTHKEY="" \ + CLIENTPORT="27005" \ + 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 $BASEDIR/garrysmod/cfg/* + +COPY cfg $BASEDIR/garrysmod/cfg + +VOLUME [ "$BASEDIR/garrysmod/volume" ] + +WORKDIR $BASEDIR + +EXPOSE 27015/udp 27015/tcp + +ENTRYPOINT [] +CMD [ \ + "sh", \ + "-c", \ + "$BASEDIR/srcds_run \ + -game garrysmod \ + -strictportbind \ + -port ${PORT} \ + -tickrate ${TICKRATE} \ + +host_workshop_collection ${WORKSHOPCOLLECTIONID} \ + -authkey ${AUTHKEY} \ + +clientport ${CLIENTPORT} \ + +gamemode ${GAMEMODE} \ + +map ${MAP} \ + +sv_setsteamaccount ${GLST} \ + +servercfgfile ${CONFIG} \ + -maxplayers ${MAXPLAYERS} \ + +sv_loadingurl ${LOADURL} \ + ${CUSTOMPARAMETERS}" \ + ] \ No newline at end of file diff --git a/minimal/cfg/mount.cfg b/minimal/cfg/mount.cfg new file mode 100644 index 0000000..07745c8 --- /dev/null +++ b/minimal/cfg/mount.cfg @@ -0,0 +1,19 @@ + +// +// Use this file to mount additional paths to the filesystem +// DO NOT add a slash to the end of the filename +// + +"mountcfg" +{ + //"cstrike" "" + //"hl1" "" + //"hl1_hd" "" + //"hl2" "" + //"hl2mp" "" + //"episodic" "" + //"ep2" "" + //"lostcoast" "" +} + + diff --git a/minimal/cfg/mountdepots.txt b/minimal/cfg/mountdepots.txt new file mode 100644 index 0000000..14ba47a --- /dev/null +++ b/minimal/cfg/mountdepots.txt @@ -0,0 +1,11 @@ +"gamedepotsystem" +{ + //"cstrike" "1" + //"hl1" "1" + //"hl1_hd" "1" + //"hl2" "1" + //"hl2mp" "1" + //"episodic" "1" + //"ep2" "1" + //"lostcoast" "1" +} \ No newline at end of file diff --git a/minimal/cfg/server.cfg b/minimal/cfg/server.cfg new file mode 100644 index 0000000..e5b2ac9 --- /dev/null +++ b/minimal/cfg/server.cfg @@ -0,0 +1,2 @@ +// Garry's Mod - Config +exec ../volume/server.cfg \ No newline at end of file