A Docker image based on steamcmd designed for self-installing game servers. Server images can have their own App ID, start and update scripts.
See the existing implementations
Creating container from existing server image
make build
docker run -it --rm -e START_ARGS="" -p 27015:27015/tcp -p 27015:27015/udp -v myserver:/home/steam/Steam/steamapps/common <server image>
Add -e STEAMCMD_LOGIN_USERNAME=username-here
and interactively login on first run if you get a susbcription or owner error.
You can also look for pre-built images here.
- Create a new game directory inside servers/ (this doubles as the image name)
- Build everything:
make build
- Test it:
image=<name here> make test
- If a login error is received during testing, test using a Steam account that owns the content:
image=<name here> options='-e STEAMCMD_LOGIN_USERNAME=yoursteamname' make test
- Upload changes by changing the Makefile's docker_user to match your DockerHub username and running:
make push
- Create a pull request to add the image to this repo.
These variables should be used whereever possible.
USER
HOME_DIR
STEAMCMD_DIR
- where steamcmd binaries areSERVERS_DIR
- where the server(s) that are installed goSERVER_DIR
- the server that is going to runSHARED_DIR
- shared directory, symlinks are automatically created to point to these files in the SERVERS_DIRIMAGE_DIR
- where files baked into the server image are (like a start or update script), they are copied to SERVER_DIR on container startSTEAMCMD_LOGIN_USERNAME
- the steam username of the account that owns the gameSTEAMCMD_UPDATE_SCRIPT
- txt update file using steamcmd update syntaxSTEAMCMD_APPEND_SCRIPT
- txt update file that is appended to the default txt file (instructions are run after login)UPDATE_SCRIPT
- shell script that executes STEAMCMD_UPDATE_SCRIPTSTART_SCRIPT
- shell script to start the game serverSTART_ARGS
- arguments of the server executable which would be read in START_SCRIPTAPP_ID
- game server's appid