You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

143 lines
4.0 KiB

8 years ago
# Steam in Docker
8 years ago
## Why?
Some people asked me why would someone want to have Steam in a Docker container?
Few main points which pushed me making this Docker container:
8 years ago
1. I want to set-up more fences when running the code I don't/can't trust; [issue 3671](https://github.com/valvesoftware/steam-for-linux/issues/3671)
8 years ago
2. I don't want to spend time on figuring out how to install Steam (what deps) in a non-Debian (or non-SteamOS) based distro;
3. I like cleanliness: I can erase Steam and all its dependencies in a matter of seconds;
And few Pros from my PoV:
- I can have Steam on my Ubuntu/openSUSE/[put any other distro I will want to use] in a short time that Docker takes when downloads this Steam container;
- Since Steam is meant to run in Debian (SteamOS) based distro, it is not a problem anymore, since it is in a container now.
Suggestions / PR's are welcomed!
8 years ago
## What's tested?
8 years ago
The following games have been tested:
- Counter-Strike: Global Offensive
7 years ago
- Alien: Isolation
- PAYDAY 2
- Insurgency
- Half-Life: Counter-Strike 1.6
8 years ago
- Iron Snout
- Toribash
7 years ago
- DeadCore (no sound)
8 years ago
Tested in Ubuntu 16.04 LTS (64bit) and openSUSE Leap 42.1
with the following GPU's:
8 years ago
- Intel HD Graphics 3000
- Intel HD Graphics 4400
- NVIDIA's GeForce GTX 560 Ti
### 01.03.2018
The following games have been tested in Ubuntu 16.04 LTS (64bit) running on Apple MacBook Pro "Core i7" 2.9 15" Touch/Mid-2017
with AMD Radeon Pro 560 graphic card:
- Half-Life: Counter-Strike 1.6
> For running games on AMD Radeon please uncomment ``/dev/kfd`` device in the docker-compose.yml file.
8 years ago
## Requirements
- [Docker](https://www.docker.com/)
- [Docker Compose](https://docs.docker.com/compose/) minimum version 1.7.3
8 years ago
# Building and launching Steam
## Launching Steam in Docker
8 years ago
The simplest way to launch Steam is by running:
8 years ago
```sh
git clone https://github.com/arno01/steam.git
cd steam
docker-compose run steam
8 years ago
```
If Steam does not start, you may need to allow your user making local
connections to X server, which can be achieved with this command on host:
8 years ago
```sh
8 years ago
xhost +SI:localuser:$(id -un)
```
You can use the following shortcut function and place it to your `~/.bash_aliases` file:
```sh
function docker_helper() {
pushd ~/docker/$1
docker-compose rm -fa "$1"
docker-compose run -d --name "$1" "$@"
popd
}
function steam() {
docker_helper "$FUNCNAME" "$@"
}
8 years ago
```
Then just use `steam` command to run Steam in docker.
## Updating Steam Docker image
You may want to re-run this command later on in order to keep the image updated:
```sh
7 years ago
VERSION=$(git rev-parse HEAD | head -c8) make
```
8 years ago
## Troubleshooting
You might want to modify the `docker-compose.yml` in case of problems, the file should be pretty self explanatory, although you may refer to the official [Docker Compose file reference](https://docs.docker.com/compose/compose-file/)
Also keep in mind to uncomment or/and add your devices to the `devices:` section there.
The best result is when you have a similar to the following output, using the `glxgears` (part of `mesa-utils` package):
If you are getting `segmentation fault` error or Steam does not start, then you could try resetting its config:
```sh
docker-compose run --rm steam --reset
8 years ago
```
## Grsecurity notes
### grsec: TPE
Trusted Path Execution (TPE)
8 years ago
This Steam docker image is working with the grsecurity patched kernel.
It only needs a `/proc/sys/kernel/grsecurity/tpe_gid` accessible by root for read.
### grsec: PaX
It is also working with PaX part of the grsecurity.
I have tested it with Half-Life games like CS 1.6, and CS:GO.
Please refer to the `launch` file if grsecurity is blocking some executable or a library.
8 years ago
# Links
Below is just bunch of links, someone might find them useful
- https://wiki.ubuntu.com/Valve
- https://developer.valvesoftware.com/wiki/Steam_under_Linux#Ubuntu
- http://media.steampowered.com/client/installer/steam.deb
- http://repo.steampowered.com/steam/archive/precise/steam_latest.deb
- http://repo.steamstatic.com/steam/
8 years ago
- https://grsecurity.net/