GOG games for Linux, installed and played inside a Docker container. A single bash script runs the game's installer and its DLCs in a container, then starts the game with your display, GPU and sound, so nothing gets installed on your host system.
- Isolated games. The game and its dependencies stay in the project folder, not on the host.
- Automatic installation. It finds the GOG installer in the folder and runs it, with every DLC and extra installer next to it.
- Graphics and sound. X11, the GPU (
/dev/dri) and audio (/dev/snd) are passed through to the container, with the runtime directory where the PipeWire or PulseAudio socket lives. - Easy cleanup. One command removes the container, the image and everything the game installed, and keeps your installers.
# clone the project into a folder named after the game
git clone https://github.com/aljazmc/gog-linux-docker-script defcon
# move the GOG game installer (for Linux) and all DLC installers into the folder
mv ~/Downloads/gog_defcon_2.0.0.5.sh defcon/
# move to the game folder
cd defcon
# install (on first run) and start the game
./project.sh start
# remove everything generated by project.sh
./project.sh cleanDuring the first start, the GOG installer window opens. Keep the default
install location, so the game ends up in the GOG Games folder inside the
project folder.
Caution
Put only one game (with its DLCs and extras) in each project folder. For more games, clone the project once per game.
| Requirement | Notes |
|---|---|
| GNU/Linux with bash | |
| Docker | with the compose plugin, running and usable by your user (no sudo) |
| X11 session | or XWayland, with DISPLAY set |
| A Linux GOG installer | a .sh file, e.g. gog_defcon_2.0.0.5.sh, plus any DLC installers |
The container uses the aljazmc/x11-debian
image, which is pulled automatically on first run.
| Command | What it does |
|---|---|
./project.sh start |
Generates docker-compose.yml. If GOG Games doesn't exist yet, it makes all .sh files executable and runs every installer in the folder. Then it finds the game's start.sh and launches the game. |
./project.sh clean |
Stops the container, removes its volumes and image (docker compose down -v --rmi all) and deletes all generated files and folders, including the installed game. Your installer .sh files are kept, so you can reinstall with ./project.sh start. |
On subsequent runs, ./project.sh start skips installation and launches the
game directly. Running ./project.sh without a command prints the usage.
Compose plugin is not installed. Exiting...: install the Docker compose plugin.No .sh file found. Exiting...: the GOG installer is missing from the project folder.- The game window doesn't open: make sure
DISPLAYis set and~/.Xauthorityexists; on some systems you may need to runxhost +local:first. - Reinstall the game: delete the
GOG Gamesfolder (or run./project.sh clean) and run./project.sh startagain.
bash tests/run.sh # every test, in seconds, without Docker
bash tests/run.sh tests/integration # one folder of them
.github/coverage.sh project.sh # the same under kcov: how much of project.sh they run
.github/test_per_fix.sh # every fix since 4 December 2026 has a testEach test is a script of its own, tests/**/test_*.sh, named after what it
checks and filed by what it tests:
tests/unit/project/: the usage, the checks for GNU/Linux and the compose plugin with their exit codes, the compose filestartwrites or keeps,startwithout an installer, and whatcleanremoves and keeps.tests/integration/start/: a wholestartwith a stand-in GOG installer,tests/fixtures/gog_fake_game_1.0.sh, that installs a fake game whosestart.shrecords its launch; and a secondstartthat launches it without installing it again.tests/unit/github/: the check of a test per fix.
They run project.sh in a temporary folder, with docker replaced by a
stand-in (tests/helpers/) that records its calls and runs what
docker compose run would run in the container right there. CI runs the
tests, ShellCheck on every script and test, the
coverage with kcov, in its job
summary, and the check of a test per fix on every push and pull request, see
.github/workflows/ci.yml. gh act runs the same
jobs on localhost in aljazmc/actions-debian (see .actrc).
The script is licensed under the MIT License. The games you install with it keep their own licenses.
