Skip to content

Latest commit

 

History

History
59 lines (45 loc) · 3.2 KB

README.md

File metadata and controls

59 lines (45 loc) · 3.2 KB

Building an Image

If you want to build an image yourself, follow the steps below. This can be useful in cases where you want to make changes to the build scripts or add custom functionality. It is also useful for testing changes before submitting a contribution to the project.

  1. Clone this project locally.
  2. Define the game you want the server to run. You can do this by setting an environment variable on your command line.
export GAME=cstrike

Before continuing to the following steps, verify that the environment variable is set by running echo $GAME in your terminal. It should send back the variable you just set.

Tip

Available options include the following, these names are recognized by the app_set_config 90 mod command in hlds.txt.

To install a specific sub version, such as a beta, you can utilize the FLAG environment variable to pass arbitrary command flags to Steam CMD. For example, export FLAG=-beta steam_legacy can be used to get a Pre-25th Anniversary build of some titles.

  1. Navigate to the container folder (where this README file is) and build the image.
docker compose build
  1. If you want to modify the server startup arguments, you can provide a command property within docker-compose.yml; for a list of available arguments, visit the Valve Developer Wiki.

Note

In most cases, you'll need to specify +map for the server to be joinable.

services:
  hlds:
    command: +maxplayers 16 +map cs_italy
  1. Start the image. Once the Half-Life Dedicated Server client starts, you'll receive a stream of messages, including the server's public IP address and any startup errors.
docker compose up
  1. Connect to your server via the public IP address by loading the game on Steam. To play, you must own a copy of the game on Steam.
  2. Optional: If you want to start a custom mod, you can modify your $GAME environment variable once the image is built before running docker compose up. This allows you to add custom scripts to the server image while telling the dedicated server client what mod to use. If you're building a custom image with the intent on playing a custom mod it's recommended that you set the $GAME variable to valve for the initial build.
$export GAME=valve
$ docker compose build
$export GAME=decay
$ docker compose up