4 changed files with 442 additions and 23 deletions
@ -1,40 +1,146 @@ |
|||
# SteamCMD Docker Image |
|||
|
|||
<p align="center"> |
|||
<a href="https://developer.valvesoftware.com/wiki/SteamCMD"><img src="https://user-images.githubusercontent.com/4478206/197542699-ae13797a-78bb-4f37-81c2-d4880fd7709f.jpg" alt="SteamCMD"></a> |
|||
<br> |
|||
<a href="https://hub.docker.com/r/gameservermanagers/steamcmd"><img src="https://img.shields.io/docker/pulls/gameservermanagers/steamcmd.svg?style=flat-square&logo=docker&logoColor=white" alt="Docker Pulls"></a> |
|||
<a href="https://github.com/GameServerManagers/docker-steamcmd/actions"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/GameServerManagers/docker-steamcmd/docker-publish.yml?style=flat-square"></a> |
|||
<a href="https://www.codacy.com/gh/GameServerManagers/docker-steamcmd/dashboard"><img src="https://img.shields.io/codacy/grade/42d400dcdd714ae080d77fcb40d00f1c?style=flat-square&logo=codacy&logoColor=white" alt="Codacy grade"></a> |
|||
<a href="https://developer.valvesoftware.com/wiki/SteamCMD"><img src="https://img.shields.io/badge/SteamCMD-000000?style=flat-square&logo=Steam&logoColor=white" alt="SteamCMD"></a> |
|||
<a href="https://github.com/GameServerManagers/docker-steamcmd/blob/main/LICENSE"><img src="https://img.shields.io/github/license/gameservermanagers/docker-steamcmd?style=flat-square" alt="MIT License"></a></p> |
|||
[](https://developer.valvesoftware.com/wiki/SteamCMD) |
|||
|
|||
## About |
|||
[](https://hub.docker.com/r/gameservermanagers/steamcmd) |
|||
[](https://github.com/GameServerManagers/docker-steamcmd/actions) |
|||
[](https://www.codacy.com/gh/GameServerManagers/docker-steamcmd/dashboard) |
|||
[](https://developer.valvesoftware.com/wiki/SteamCMD) |
|||
[](https://github.com/GameServerManagers/docker-steamcmd/blob/main/LICENSE) |
|||
|
|||
SteamCMD is a command-line version of the Steam client. It allows you to download and install games on a headless server. This container image builds daily and is available on [Docker Hub](https://hub.docker.com/r/gameservermanagers/steamcmd) as well as [GitHub Container Registry](https://github.com/GameServerManagers/docker-steamcmd/pkgs/container/steamcmd). |
|||
> Lightweight, daily-built SteamCMD base image for game server automation. |
|||
|
|||
## Tags |
|||
## Quick Start |
|||
|
|||
- `latest`, `ubuntu` - Latest Ubuntu LTS release |
|||
- `ubuntu-24.04` - Ubuntu 24.04 LTS 'Noble Numbat' |
|||
- `ubuntu-22.04` - Ubuntu 22.04 LTS 'Jammy Jackalope' |
|||
- `ubuntu-20.04` - Ubuntu 20.04 LTS 'Focal Fossa' |
|||
- `ubuntu-18.04` - Ubuntu 18.04 LTS 'Bionic Beaver' |
|||
Pull the latest image and open SteamCMD interactive prompt: |
|||
|
|||
## Usage |
|||
```bash |
|||
docker pull gameservermanagers/steamcmd:latest |
|||
docker run -it --rm gameservermanagers/steamcmd:latest |
|||
``` |
|||
|
|||
Docker cli |
|||
Download (update) a dedicated server into the current host directory (example: CS2 / app 730): |
|||
|
|||
```bash |
|||
docker run -it gameservermanagers/steamcmd:latest |
|||
docker run -it --rm \ |
|||
-v "$PWD:/data" \ |
|||
gameservermanagers/steamcmd:latest \ |
|||
+force_install_dir /data +login anonymous +app_update 730 validate +quit |
|||
``` |
|||
|
|||
Download Counter Strike: Global Offensive Dedicated Server to current host directory. |
|||
Persist Steam content in a named volume: |
|||
|
|||
```bash |
|||
docker volume create steamcmd-data |
|||
docker run -it --rm -v steamcmd-data:/home/steam/Steam gameservermanagers/steamcmd:latest +login anonymous +quit |
|||
``` |
|||
|
|||
## Tags & Platforms |
|||
|
|||
| Tag(s) | Ubuntu Release | Notes | |
|||
| ------ | -------------- | ----- | |
|||
| `latest`, `ubuntu` | 24.04 LTS (Noble) | Alias to most recent LTS | |
|||
| `ubuntu-24.04` | 24.04 LTS | Current LTS | |
|||
| `ubuntu-22.04` | 22.04 LTS | Previous LTS | |
|||
| `ubuntu-20.04` | 20.04 LTS | Legacy (receives security updates) | |
|||
| `ubuntu-18.04` | 18.04 LTS | Legacy / nearing EOL upstream | |
|||
|
|||
Currently built for: `linux/amd64`. |
|||
|
|||
## Features |
|||
|
|||
- Daily scheduled build + build on Dockerfile changes |
|||
- Non-root `steam` user (security best practice) |
|||
- Minimal packages; apt caches cleaned |
|||
- HEALTHCHECK (lightweight SteamCMD invocation) |
|||
- Multi-version tag set for pinning |
|||
|
|||
## Usage Examples |
|||
|
|||
Anonymous login and quit (cache initialization): |
|||
|
|||
```bash |
|||
docker run --rm gameservermanagers/steamcmd:latest +login anonymous +quit |
|||
``` |
|||
|
|||
Install/Update Valheim dedicated server (app 896660) into a local folder: |
|||
|
|||
```bash |
|||
mkdir -p valheim && \ |
|||
docker run --rm -v "$PWD/valheim:/data" gameservermanagers/steamcmd:latest \ |
|||
+force_install_dir /data +login anonymous +app_update 896660 validate +quit |
|||
``` |
|||
|
|||
Run with a different timezone: |
|||
|
|||
```bash |
|||
docker run --rm -e TZ=UTC gameservermanagers/steamcmd:latest +login anonymous +quit |
|||
``` |
|||
|
|||
## Data Persistence |
|||
|
|||
Steam content is stored under `/home/steam/Steam` (owned by the non-root `steam` user). Mount a volume there to persist downloads across runs. |
|||
|
|||
```bash |
|||
docker run -it -v $PWD:/data gameservermanagers/steamcmd:latest +force_install_dir /data +login anonymous +app_update 740 +quit |
|||
docker run -v steamcmd-data:/home/steam/Steam gameservermanagers/steamcmd:latest +login anonymous +quit |
|||
``` |
|||
|
|||
## Notes |
|||
## Configuration |
|||
|
|||
Common tunables (all optional): |
|||
|
|||
| Option | How | Purpose | |
|||
| ------ | --- | ------- | |
|||
| Timezone | `-e TZ=Europe/London` | Control tzdata (if installed) | |
|||
| Working dir | `-w /home/steam` | Override working directory | |
|||
| User mapping | `--user $(id -u):$(id -g)` | Run with host UID/GID (if perms needed) | |
|||
|
|||
Steam credentials (if you need a non-anonymous app): |
|||
|
|||
```bash |
|||
docker run -it --rm gameservermanagers/steamcmd:latest +login <username> <password> +app_update <appid> +quit |
|||
``` |
|||
|
|||
Consider using Steam Guard / login tokens; avoid embedding secrets in shell history. Use `--env-file` for larger sets of env variables if needed. |
|||
|
|||
## Healthcheck |
|||
|
|||
The image defines a `HEALTHCHECK` that periodically performs a minimal anonymous login and metadata refresh. To disable at runtime, you can override with `--no-healthcheck` (Docker 25+) or build your own image `FROM` this one and use `HEALTHCHECK NONE`. |
|||
|
|||
## Security Notes |
|||
|
|||
- Runs as non-root `steam` |
|||
- Network access only to Steam endpoints during operations |
|||
- Keep host Docker updated; image alone does not mitigate kernel CVEs |
|||
|
|||
## Contributing |
|||
|
|||
Issues & PRs welcome. Before submitting: |
|||
|
|||
1. Run formatters: `prettier --write .` |
|||
2. Run linters: super-linter workflow (or locally with the provided dev container) |
|||
3. Keep layers minimal; squash RUN chains where reasonable |
|||
|
|||
## Related Projects |
|||
|
|||
- [LinuxGSM](https://linuxgsm.com) – Game server management |
|||
- [steamcmd/docker](https://github.com/steamcmd/docker) – Upstream reference |
|||
|
|||
## License |
|||
|
|||
MIT – see [LICENSE](./LICENSE.md). |
|||
|
|||
--- |
|||
|
|||
> Looking for additional architectures or features? Open an issue to discuss multi-arch builds or tag deprecation timelines. |
|||
|
|||
## Troubleshooting |
|||
|
|||
Empty output directory: |
|||
|
|||
- Ensure the order: `+force_install_dir` comes BEFORE `+login` (SteamCMD requirement – it warns otherwise). If reversed, files may go to the default Steam library inside the container instead of your mounted directory. |
|||
- Verify permissions: the container runs as user `steam` (UID 1000). If your host user ID differs and you see permission errors, try adding `--user $(id -u):$(id -g)` or pre-chown the host directory. |
|||
- Add `validate` only when necessary; it forces extra file checks and can slow installs. |
|||
|
|||
|
|||
This container is based off of the [steamcmd](https://github.com/steamcmd/docker) container and is primarily used for [LinuxGSM](https://linuxgsm.com) game servers. |
|||
Confirm installation path by adding `+app_status <appid>` before `+quit` to inspect state. |
|||
|
@ -0,0 +1,77 @@ |
|||
{ |
|||
"name": "docker-steamcmd", |
|||
"lockfileVersion": 3, |
|||
"requires": true, |
|||
"packages": { |
|||
"": { |
|||
"dependencies": { |
|||
"prettier-plugin-sh": "^0.18.0" |
|||
} |
|||
}, |
|||
"node_modules/@reteps/dockerfmt": { |
|||
"version": "0.3.6", |
|||
"resolved": "https://registry.npmjs.org/@reteps/dockerfmt/-/dockerfmt-0.3.6.tgz", |
|||
"integrity": "sha512-Tb5wIMvBf/nLejTQ61krK644/CEMB/cpiaIFXqGApfGqO3GwcR3qnI0DbmkFVCl2OyEp8LnLX3EkucoL0+tbFg==", |
|||
"license": "MIT", |
|||
"engines": { |
|||
"node": "^v12.20.0 || ^14.13.0 || >=16.0.0" |
|||
} |
|||
}, |
|||
"node_modules/prettier": { |
|||
"version": "3.6.2", |
|||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", |
|||
"integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", |
|||
"license": "MIT", |
|||
"peer": true, |
|||
"bin": { |
|||
"prettier": "bin/prettier.cjs" |
|||
}, |
|||
"engines": { |
|||
"node": ">=14" |
|||
}, |
|||
"funding": { |
|||
"url": "https://github.com/prettier/prettier?sponsor=1" |
|||
} |
|||
}, |
|||
"node_modules/prettier-plugin-sh": { |
|||
"version": "0.18.0", |
|||
"resolved": "https://registry.npmjs.org/prettier-plugin-sh/-/prettier-plugin-sh-0.18.0.tgz", |
|||
"integrity": "sha512-cW1XL27FOJQ/qGHOW6IHwdCiNWQsAgK+feA8V6+xUTaH0cD3Mh+tFAtBvEEWvuY6hTDzRV943Fzeii+qMOh7nQ==", |
|||
"license": "MIT", |
|||
"dependencies": { |
|||
"@reteps/dockerfmt": "^0.3.6", |
|||
"sh-syntax": "^0.5.8" |
|||
}, |
|||
"engines": { |
|||
"node": ">=16.0.0" |
|||
}, |
|||
"funding": { |
|||
"url": "https://opencollective.com/unts" |
|||
}, |
|||
"peerDependencies": { |
|||
"prettier": "^3.6.0" |
|||
} |
|||
}, |
|||
"node_modules/sh-syntax": { |
|||
"version": "0.5.8", |
|||
"resolved": "https://registry.npmjs.org/sh-syntax/-/sh-syntax-0.5.8.tgz", |
|||
"integrity": "sha512-JfVoxf4FxQI5qpsPbkHhZo+n6N9YMJobyl4oGEUBb/31oQYlgTjkXQD8PBiafS2UbWoxrTO0Z5PJUBXEPAG1Zw==", |
|||
"license": "MIT", |
|||
"dependencies": { |
|||
"tslib": "^2.8.1" |
|||
}, |
|||
"engines": { |
|||
"node": ">=16.0.0" |
|||
}, |
|||
"funding": { |
|||
"url": "https://opencollective.com/sh-syntax" |
|||
} |
|||
}, |
|||
"node_modules/tslib": { |
|||
"version": "2.8.1", |
|||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", |
|||
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", |
|||
"license": "0BSD" |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,24 @@ |
|||
{ |
|||
"dependencies": { |
|||
"prettier-plugin-sh": "^0.18.0" |
|||
}, |
|||
"name": "docker-steamcmd", |
|||
"version": "1.0.0", |
|||
"description": "<p align=\"center\"> <a href=\"https://developer.valvesoftware.com/wiki/SteamCMD\"><img src=\"https://user-images.githubusercontent.com/4478206/197542699-ae13797a-78bb-4f37-81c2-d4880fd7709f.jpg\" alt=\"SteamCMD\"></a> <br> <a href=\"https://hub.docker.com/r/gameservermanagers/steamcmd\"><img src=\"https://img.shields.io/docker/pulls/gameservermanagers/steamcmd.svg?style=flat-square&logo=docker&logoColor=white\" alt=\"Docker Pulls\"></a> <a href=\"https://github.com/GameServerManagers/docker-steamcmd/actions\"><img alt=\"GitHub Workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/GameServerManagers/docker-steamcmd/docker-publish.yml?style=flat-square\"></a> <a href=\"https://www.codacy.com/gh/GameServerManagers/docker-steamcmd/dashboard\"><img src=\"https://img.shields.io/codacy/grade/42d400dcdd714ae080d77fcb40d00f1c?style=flat-square&logo=codacy&logoColor=white\" alt=\"Codacy grade\"></a> <a href=\"https://developer.valvesoftware.com/wiki/SteamCMD\"><img src=\"https://img.shields.io/badge/SteamCMD-000000?style=flat-square&logo=Steam&logoColor=white\" alt=\"SteamCMD\"></a> <a href=\"https://github.com/GameServerManagers/docker-steamcmd/blob/main/LICENSE\"><img src=\"https://img.shields.io/github/license/gameservermanagers/docker-steamcmd?style=flat-square\" alt=\"MIT License\"></a></p>", |
|||
"main": "index.js", |
|||
"devDependencies": {}, |
|||
"scripts": { |
|||
"test": "echo \"Error: no test specified\" && exit 1" |
|||
}, |
|||
"repository": { |
|||
"type": "git", |
|||
"url": "git+https://github.com/GameServerManagers/docker-steamcmd.git" |
|||
}, |
|||
"keywords": [], |
|||
"author": "", |
|||
"license": "ISC", |
|||
"bugs": { |
|||
"url": "https://github.com/GameServerManagers/docker-steamcmd/issues" |
|||
}, |
|||
"homepage": "https://github.com/GameServerManagers/docker-steamcmd#readme" |
|||
} |
Loading…
Reference in new issue