Skip to content

rivet-gg/godot-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Godot + Docker

These Dockerfiles help get up and running with Godot 4.

Upgrading Godot

The container can be built with

docker build --build-arg GODOT_VERSION=4.2 .

See available Godot versions

Recommended usage

Isolated Build Environments

Godot projects can be built quickly by mounting volumes like:

mkdir -p build/linux
docker run -v "$(pwd):/app" rivetgg/godot:4.2 \
    --export-release "Linux/X11" \
    --headless ./build/linux/game.x86_64

See also godot-ci for Dockerfiles tailored for CI environments.

Containerizing For Production

If running Godot as a dedicated server in production, we recommend using the following Dockerfile:

# MARK: Builder
FROM rivetgg/godot:4.2 AS builder
COPY . .
RUN mkdir -p build/linux \
    && godot -v --export-release "Linux/X11" --headless ./build/linux/game.x86_64

# MARK: Runner
FROM ubuntu:22.04
RUN apt update -y \
    && apt install -y expect-dev \
    && rm -rf /var/lib/apt/lists/*

COPY --from=builder /app/build/linux/ /app

# Unbuffer output so the logs get flushed
CMD ["sh", "-c", "unbuffer /app/game.x86_64 --verbose --headless -- --server | cat"]

FAQ

Why use Docker Hub instead of GitHub Container Registry?

GHCR requires authentication with your GitHub account in order to pull images. Many developer don't have this set up, so we opt to use Docker Hub, since it does not require authentication.

About

Dockerfiles to help containerize Godot 4

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages