Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 1.28 KB

README.md

File metadata and controls

51 lines (35 loc) · 1.28 KB

Godot + Docker

These Dockerfiles help get up and running with Godot 4.

Uprading Godot

The container can be built with

docker build --build-arg GODOT_VERSION=4.2.1 .

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" ghcr.io/rivet-gg/godot-docker/godot:4.2.1 \
    --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 ghcr.io/rivet-gg/godot-docker/godot:4.2.1 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"]