HUB
Sign inSign up

aljazmc/godot-buildforwindows

By aljazmc

•Updated 1 day ago

Docker image with Godot and the Windows export templates

Image
Integration & delivery
Developer tools
0

825

aljazmc/godot-buildforwindows repository overview

⁠aljazmc/godot-buildforwindows

Godot with its Windows export templates, for exporting Godot games as a single Windows .exe.

Docker pulls Image size Version platforms: amd64 | arm64 Debian: 13.7 Godot: 4.7.2 Godot license: MIT CI Dockerfile license: MIT

Docker Hub⁠ · Source⁠ · All images⁠

⁠Overview

Base imagedebian:13.7
SoftwareGodot 4.7.2 (official build) with export templates
Also includedzip, ShellCheck
Usergodot (uid 1000) with passwordless sudo (sudo apt-get install ...)
Tagslatest, 4.7.2, 4.7.2-YYYYMMDD

⁠Quick start

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"

⁠Usage with Docker Compose

## 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"

⁠How to export the project

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.

⁠Notes
  • binary_format/embed_pck=true puts the game data inside the executable. Without it, keep hello.pck next to hello.exe.
  • For an arm64 build, set 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.
  • The executable isn't signed, so SmartScreen may ask for confirmation: "More info" → "Run anyway".
  • The image only builds for Windows, it can't run the game. The game can be tested on Linux with Wine, e.g. with the aljazmc/wine-debian⁠ image.

⁠How to make a single executable .exe

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.

⁠Notes
  • If the project needs more files next to the executable, e.g. GDExtension DLLs or a separate 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).

⁠Tags

  • 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 is the official build and export templates from GitHub, pinned with GODOT_VERSION in the Dockerfile.

⁠License

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:

SoftwareLicenseIn the image
Godot Engine⁠MITgodot --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.

Tag summary

Content type

Image

Digest

sha256:68c7d22a0…

Size

416.1 MB

Last updated

1 day ago

docker pull aljazmc/godot-buildforwindows