Docker root user issue while using Godot Docker Example

Hello there! I'm trying to create Rivet integration with my own Multiplayer Library. But after deployment, Rivet CLI seems to not allow for root user. I'm not exactly sure how to make the DockerFile work as docker newbie myself. Helps are appreciated! DockerFile (same one from the wiki):
FROM ghcr.io/rivet-gg/images/godot:4.2 AS builder
WORKDIR /app
COPY . .
RUN mkdir -p build/linux \
&& godot -v --export-release "Linux/X11" --headless ./build/linux/game.x86_64

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"]
FROM ghcr.io/rivet-gg/images/godot:4.2 AS builder
WORKDIR /app
COPY . .
RUN mkdir -p build/linux \
&& godot -v --export-release "Linux/X11" --headless ./build/linux/game.x86_64

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"]
No description
5 Replies
AngelOnFira
AngelOnFiraโ€ข2y ago
Hey! Checking this out now ๐Ÿ™‚ So Rivet doesn't start uploaded containers that use root for security issues. So let's get this sorted for you Oh ya, this is totally my bad, I didn't add the change to make the Docker container non-root One sec
AngelOnFira
AngelOnFiraโ€ข2y ago
If you take a look at this repo, the example here should be pretty reliable ๐Ÿ™‚ https://github.com/rivet-gg/examples/tree/main/godot/bomber
GitHub
examples/godot/bomber at main ยท rivet-gg/examples
๐Ÿ–ผ๏ธ Example projects & tutorials for Godot, Unity, Unreal, HTML5, and more - rivet-gg/examples
AngelOnFira
AngelOnFiraโ€ข2y ago
# MARK: Builder
FROM ghcr.io/rivet-gg/godot-docker/godot:4.2 AS builder
WORKDIR /app
COPY . .
RUN mkdir -p build/linux \
&& godot -v --export-release "Linux/X11" ./build/linux/game.x86_64 --headless

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

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

# Change to user rivet
USER rivet

# Unbuffer output so the logs get flushed
CMD ["sh", "-c", "unbuffer /app/game.x86_64 --verbose --headless -- --server | cat"]
# MARK: Builder
FROM ghcr.io/rivet-gg/godot-docker/godot:4.2 AS builder
WORKDIR /app
COPY . .
RUN mkdir -p build/linux \
&& godot -v --export-release "Linux/X11" ./build/linux/game.x86_64 --headless

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

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

# Change to user rivet
USER rivet

# Unbuffer output so the logs get flushed
CMD ["sh", "-c", "unbuffer /app/game.x86_64 --verbose --headless -- --server | cat"]
That's the version in there ๐Ÿ™‚ lmk if you run into anything else! btw, updating the original docs right now ๐Ÿ‘๐Ÿป
maji
majiOPโ€ข2y ago
Alrighty. Works now, thanks for the assistance! :vennieflower:
No description
AngelOnFira
AngelOnFiraโ€ข2y ago
Great! Do ping if you have more questions :gdparty:

Did you find this page helpful?