Sign inSign up

apfelwurm/csgo-get5-docker-dev

By apfelwurm

•Updated over 3 years ago

provides a CS:GO server to develop and test get5 (https://github.com/splewis/get5)

Image
0

8.2K

apfelwurm/csgo-get5-docker-dev repository overview

⁠

⁠ csgo-get5-docker-dev

Development container for get5

⁠ ⁠ ⁠ ⁠

⁠1. Introduction

This image aims to provide a CS:GO server to develop and test get5⁠.

Do not use this in production to run your matches!

Everything that can be changed about the server can be set using environment variables passed to Docker on container creation.

If you want to use your local build you have to build it first using this instructions⁠

For further information please read the docs⁠.

⁠2. Using the image

⁠2.1 Quickstart
  1. Download the image from Docker hub⁠:
docker pull apfelwurm/csgo-get5-docker-dev:latest
  1. Launch a container:
docker run --rm -it --network=host apfelwurm/csgo-get5-docker-dev:latest

At minimum, you'll probably want to launch the container with the following environment variables set:

  • -it: run the container interactive. There will be problems if you don't run it interactiveley.

  • --network=host: use the host machine's ports and IP address, rather than running within an isolated Docker network that's not visible to the outside world.

  • -e RCON_PASSWORD=<some other password>: set the RCON (admin) password.

If you want to start the server with a loaded config, set:

  • -e MATCH_CONFIG=<your match config>: start the server with the given JSON config loaded with Get5.
⁠2.3 Examples
⁠2.3.1 Starting a server with no match config with your local get5 development build

Start a server with:

  • The host machine's IP address
  • The specified port, GOTV port, password, RCON password, GOTV password
docker run --rm -it --network=host \
 -e GOTV_ENABLE=1 \
 -e PORT=1234 \
 -e GOTV_PORT=1235 \
 -e GOTV_DELAY=15 \
 -e PASSWORD=mypass \
 -e RCON_PASSWORD=adminpass \
 -e GOTV_PASSWORD=gotvpass \
 -e GET5_VER=LOCAL\
 -v $PWD/builds/get5:/localmounts/get5 \
 apfelwurm/csgo-get5-docker-dev:latest
⁠2.3.2 Starting a server with a match config

Start a server with:

  • The host machine's IP address
  • The specified port, GOTV port, password, RCON password, GOTV password
  • The given Get5 config loaded
docker run --rm -it --network=host \
 -e GOTV_ENABLE=1 \
 -e PASSWORD=mypass \
 -e RCON_PASSWORD=adminpass \
 -e GOTV_PASSWORD=gotvpass \
 -e GOTV_DELAY=15 \
 -e MATCH_CONFIG="{'matchid': '81a99ef9a2844c278c2bda2f5a77a793', \
                   'num_maps': 3, \
                   'maplist': ['de_dust2', 'de_inferno', 'de_mirage', 'de_nuke', 'de_overpass', 'de_train', 'de_vertigo'], \
                   'skip_veto': False, \
                   'team1': {'name': 'Astralis', \
                             'tag': 'AST', \
                             'players': {698652696634933762: 'gla1ve', \
                                         234783204182937471: 'Magisk', \
                                         389371614622221912: 'dev1ce', \
                                         951311418417028314: 'dupreeh', \
                                         369417162788295143: 'Xyp9x'}}, \
                   'team2': {'name': 'Natus Vincere', \
                             'tag': 'NAVI', \
                             'players': {875407653610178066: 's1mple', \
                                         979550479724346962: 'Boombl4', \
                                         186841562108230104: 'electronic', \
                                         726408891643982724: 'Perfecto', \
                                         512316566954794515: 'flamie'}}}" \
 apfelwurm/csgo-get5-docker-dev:latest

⁠3. Environment variables

Setting environment variables when starting a container allows you to manipulate the launch options of the server.

For example, docker run -it -e PASSWORD=1234 apfelwurm/csgo-get5-docker-dev:latest will start a new server with password 1234 by launching the server with +sv_password 1234.

All possible environment variables are displayed in the table below.

Variable nameLaunch optionDescription
STEAMWORKS_VERThis determinates which steamworks⁠ version will be installed on the startup. This can either be a version (like 1.2.3c ) or a url to a tgz file (like https://github.com/KyleSanderson/SteamWorks/releases/download/1.2.3c/package-lin.tgz) or LOCAL. If you set it to LOCAL, you can use the corresponding mountpoint ( see below⁠ ) to mount an extracted version. (for current default, look into the dockerfile)
METAMOD_VERThis determinates which metamod⁠ version will be installed on the startup. This can either be a version (like 1.12 ) or a url to a tar.gz file (like https://mms.alliedmods.net/mmsdrop/1.11/mmsource-1.11.0-git1148-linux.tar.gz) or LOCAL. If you set it to LOCAL, you can use the corresponding mountpoint ( see below⁠ ) to mount an extracted version. (for current default, look into the dockerfile)
SOURCEMOD_VERThis determinates which sourcemod⁠ version will be installed on the startup. This can either be a version (like 1.11 ) or a url to a tar.gz file (like https://sm.alliedmods.net/smdrop/1.11/sourcemod-1.11.0-git6915-linux.tar.gz) or LOCAL. If you set it to LOCAL, you can use the corresponding mountpoint ( see below⁠ ) to mount an extracted version. (for current default, look into the dockerfile)
GET5_VERThis determinates which get5⁠ version will be installed on the startup. This can either be a version (like 0.10.5 ) or a url to a tar.gz file (like https://github.com/splewis/get5/releases/download/v0.10.5/get5-v0.10.5.tar.gz) or LATEST for the latest stable version, LATEST-PRE for the latest nightly or LOCAL. If you set it to LOCAL, you can use the corresponding mountpoint ( see below⁠ ) to mount an extracted version. (for current default, look into the dockerfile)
GET5_APISTATSThis determinates which apistats plugin should be activated on the startup. you can set this to get5_apistats or get5_mysqlstats or your own plugins name (must be contained in the local / downloaded get5 folder). Alternativeley you can set it to LOCAL, you can use the corresponding mountpoint ( see below⁠ ) to mount an extracted version (default: false)
SERVER_TOKEN+sv_setsteamaccountThe Steam Game Server Login Token for this instance, required for the server to be accessible to non-LAN connections. Generate one here⁠ (default: not set, ie LAN connections only).
PASSWORD+sv_passwordPassword required to connect to the server (default: not set)
RCON_PASSWORD+rcon_passwordPassword required to establish an RCON (remote console) connection to the server (default: not set)
PORT-portServer port (default: 27015)
GOTV_ENABLE+tv_enableGOTV Enable (default: 0)
GOTV_PORT+tv_portGOTV port (default: 27020)
GOTV_PASSWORD+tv_passwordGOTV password (default: not set)
GOTV_DELAY+tv_delayGOTV delay (default: 15)
GOTV_SNAPSHOTRATE+tv_snapshotrateGOTV Snapshot rate (default: 32)
TICKRATE-tickrateServer tick rate (64 or 128; default: 128)
MAXPLAYERS-maxplayers_overrideLimit how many players the server can contain (default: 30)
GAMETYPE+game_typeUse GAMETYPE and GAMEMODE to set what game mode is played (default: GAMETYPE=0, GAMEMODE=1, which sets game mode to competitive). Note this will be overriden by Get5.
GAMEMODE+game_modeSee above.
MAPGROUP+mapgroupThe map group to cycle through. Given this will be overridden by Get5, probably leave it as default (default: mg_active).
MAP+mapThe map that the server starts on. Must be a valid CSGO map, e.g. de_mirage.
HOST_WORKSHOP_COLLECTION+host_workshop_collectionSet the maps in specified workshop collection as the server's map list (default: not set)
WORKSHOP_START_MAP+workshop_start_mapGet the latest version of the workshop map with the specified ID and set it as the starting map (default: not set)
WORKSHOP_AUTHKEY-authkeySet a Steam Web API authkey, required to download maps from the workshop. Generate one here⁠ (default: not set).
AUTOEXEC+execA .cfg file to be executed on startup. Note anything you set here will probably be overwritten by Get5 when a match is loaded, so it's fairly useless (default: not set).
UPDATE_ON_LAUNCH-autoupdate1: Check for CS:GO updates on container launch, 0: do not check for updates. (default: 1)
CUSTOM_ARGSA string containing any additional launch options to pass to the dedicated server (default: not set)
MATCH_CONFIGIf set to a valid JSON match config, the server starts with the config loaded. (#using-get5-for-match-creation) for more on using Get5. (Default: not set.)

Launch options are appended to the following set of basic launch options that are passed as arguments to srcds, the dedicated server program:

-game csgo -console -usercon -steam_dir $STEAMCMD_DIR -steamcmd_script $STEAMCMD_DIR/steamcmd.sh -ip 0.0.0.0

⁠4. Mountpoints

Mountpoint pathDescription
/localmounts/servercfgIf something is in here, the whole content will be copied recursive to the cfg folder of the srcds csgo folder and overwrites what is there right before the server starts.
/localmounts/get5cfgIf something is in here, the whole content will be copied recursive to the addons/sourcemod/configs/get5 folder of the srcds csgo folder and overwrites what is there.
/localmounts/steamworksIf setting STEAMWORKS_VER to LOCAL the contents of the here mounted subfolder addons is copied to the corresponding srcds csgo folder
/localmounts/metamodIf setting METAMOD_VER to LOCAL the contents of the here mounted folder content is copied to the corresponding srcds csgo folders
/localmounts/sourcemodIf setting SOURCEMOD_VER to LOCAL the contents of the here mounted folder content is copied to the corresponding srcds csgo folders
/localmounts/get5If setting GET5_VER to LOCAL the contents of the here mounted subfolders addons and cfg are copied to the corresponding srcds csgo folder
/localmounts/get5_apistatsIf setting GET5_APISTATS to LOCAL the contents of the here mounted subfolders addons and cfg are copied to the corresponding srcds csgo folder

⁠5. Keeping the image up to date

⁠5.1 Updates on launch

By default, when a container is started from the image, it checks for CS:GO updates and installs them. Note that this will not modify your local copy of the image, so future containers will also have to download the update. To disable checking for updates on launch, set the environment variable UPDATE_ON_LAUNCH to be 0.

⁠5.2 Scheduled and manual updates

For ensuring that an image contains the latest CS:GO version, two scripts are provided, one for local images and one for the image in the DockerHub repo. These can be run manually or at scheduled intervals. They run the following steps:

  1. Check the version of CS:GO installed on the image
  2. If the version differs from the latest version of CS:GO according the Steam Web API, then a container is spawned running server-scripts/server-update.sh, which installs CS:GO updates
  3. The changes to the container are committed to the image and the image label updated to show the version of CS:GO installed
  4. The image is pushed to the registry (image_update/update-image-remote.sh only)

The image updater scripts use jq to parse JSON objects from the Steam Web API. Install it using sudo apt install jq.

⁠5.2.1 Local version

To keep your local image up to date, you can schedule a cron job to run updated-local-image.sh at given intervals. For example:

  1. Run crontab -e to edit the crontab for the current user
  2. Add the following line to the opened file:
10 * * * * /home/myuser/csgo-get5-docker-dev/update-local-image.sh > /home/myuser/csgo-get5-docker-dev/cron.log

This will run the script /home/myuser/csgo-get5-docker-dev/update-local-image.sh at 10 minutes past the hour every hour, and log the output to /home/myuser/csgo-get5-docker-dev/cron.log.

⁠5.2.2 Version on DockerHub

The workflow "Uses latest CS:GO version"⁠ checks that the version of CSGO on the image in the DockerHub registry matches the latest CS:GO patch released on Steam. If the versions missmatch, a issue is created here.

I run the image_update/update-image-remote.sh locally if nessecary and as soon as the docker hub is updated, i'll close the corresponding issue.

So if the image is already updated (which should happen soon after the release), you can simply run docker pull apfelwurm/csgo-get5-docker-dev:latest again to update.

Tag summary

Content type

Image

Digest

sha256:90e263fa6…

Size

17.1 GB

Last updated

over 3 years ago

docker pull apfelwurm/csgo-get5-docker-dev