Docker image with Godot and the Windows export templates
825
Godot with its Windows export templates, for exporting Godot games as a single Windows .exe.
Docker Hub · Source · All images
| Base image | debian:13.7 |
| Software | Godot 4.7.2 (official build) with export templates |
| Also included | zip, ShellCheck |
| User | godot (uid 1000) with passwordless sudo (sudo apt-get install ...) |
| Tags | latest, 4.7.2, 4.7.2-YYYYMMDD |
Run in an empty directory; the commands work on the files of the current directory, mounted as the home directory of the container. CI runs these commands to check that they work.
# the Godot version and its export templates
docker run --rm aljazmc/godot-buildforwindows "godot --headless --version && ls \$XDG_DATA_HOME/godot/export_templates/*"
# export the project with its Windows Desktop preset: a single hello.exe
docker run --rm -v .:/home/godot -w /home/godot aljazmc/godot-buildforwindows "godot --headless --import && mkdir -p build/windows && godot --headless --export-release 'Windows Desktop' build/windows/hello.exe"
# zip it for sharing
docker run --rm -v .:/home/godot -w /home/godot aljazmc/godot-buildforwindows "cd build/windows && zip -q ../hello-windows.zip hello.exe"
## docker-compose.yml example
services:
godot:
image: aljazmc/godot-buildforwindows
working_dir: /home/godot
user: godot
volumes:
- .:/home/godot
## run commands in the container:
docker compose run --rm godot "godot --headless --import && godot --headless --export-release \"Windows Desktop\" build/windows/hello.exe"
The commands expect a Godot 4 project in the current directory with an export_presets.cfg that has a Windows Desktop preset, like this one. Godot doesn't create the output directory, so the commands do.
[preset.0]
name="Windows Desktop"
platform="Windows Desktop"
runnable=true
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="build/windows/hello.exe"
[preset.0.options]
binary_format/embed_pck=true
binary_format/architecture="x86_64"
## export and bundle the game:
docker compose run --rm godot '
godot --headless --import &&
godot --headless --export-release "Windows Desktop" build/windows/hello.exe &&
cd build/windows && zip -q ../hello-win64.zip hello.exe
'
The result is build/windows/hello.exe and the build/hello-win64.zip archive. Extract the archive on a 64-bit Windows machine and run hello.exe.
binary_format/embed_pck=true puts the game data inside the executable. Without it, keep hello.pck next to hello.exe.binary_format/architecture="arm64" in export_presets.cfg.--import imports the project's resources first. It is only needed when resources were added or changed outside of the editor.build/.gdignore keeps Godot from importing the exported files.Nothing else is needed: with binary_format/embed_pck=true (set in the generated export_presets.cfg) the exported build/windows/hello.exe already is a single executable with the game data inside. Copy it to a 64-bit Windows machine and run it.
hello.pck, pack them into one self-extracting .exe with NSIS like in heaps/buildforwindows (makensis isn't installed in this image: sudo apt-get update && sudo apt-get install nsis).latest: the newest build.4.7.2: the Godot version in the image, e.g. aljazmc/godot-buildforwindows:4.7.2. Use it to stay on a known version.4.7.2-YYYYMMDD: the same version, built on that date (UTC), e.g. 4.7.2-20261122. Every build gets its own tag that never moves, so use it where you need exactly the same image again.GODOT_VERSION in the Dockerfile.The Dockerfile, the scripts and this README are part of aljazmc/dockerfiles, released under the MIT License.
The software in the image keeps its own license:
| Software | License | In the image |
|---|---|---|
| Godot Engine | MIT | godot --headless --version, godotengine.org/license |
Every other package keeps its license too: apk info --license <package> shows it on Alpine, /usr/share/doc/<package>/copyright on Debian.
Content type
Image
Digest
sha256:68c7d22a0…
Size
416.1 MB
Last updated
1 day ago
docker pull aljazmc/godot-buildforwindows