Skip to content

2. Create and push your Dockerfile

Your image must contain everything the server needs at runtime: the server build, third-party libraries (anti-cheat, Steam SDK and so on) and an ENTRYPOINT that starts the server process. An invalid entrypoint stops the container from starting, so test it locally first.

A minimal template:

FROM ubuntu:24.04
# add a non-root user to run the server
RUN useradd -m gameuser
# copy your server files, owned by that user
COPY --chown=gameuser:gameuser . /home/gameuser/MyGame/
RUN chmod +x /home/gameuser/MyGame/GameServer.sh
USER gameuser
# start the game server
ENTRYPOINT ["/home/gameuser/MyGame/GameServer.sh", "-log"]

Gameye nodes run linux/amd64. If you build on an Apple silicon Mac or another ARM machine, build for that platform explicitly:

Terminal window
docker build --platform linux/amd64 -t mygame/server:build-001 .

You pick the network mode when you create the application. It decides how your server finds the port players connect to.

BridgeHost
How ports workYour server listens on a fixed container port (for example 7777). Gameye maps it to a free port on the node.The container uses the node’s network directly. Your server must listen on the port Gameye assigns.
Port conflictsNone: each container has its own network namespaceYour server must use the assigned port, or it can collide with other containers
What your server must doNothing: listen on the container port you configuredRead its port from an environment variable at startup
OverheadSmall overhead from Docker’s port mappingNone

If you’re unsure, use bridge. You can change it later by editing the application.

In both modes you declare your ports on the application (protocol and container port, for example UDP 7777). You don’t need EXPOSE lines in the Dockerfile: Gameye publishes the ports configured on the application.

Gameye passes every assigned host port to the container as an environment variable, in both modes:

GAMEYE_PORT_{PROTOCOL}_{CONTAINER_PORT}
VariableMeaning
GAMEYE_PORT_UDP_7777The host port players use for container port UDP 7777
GAMEYE_PORT_TCP_8080The host port players use for container port TCP 8080

In host mode your server must listen on these ports. In bridge mode they tell the server which public port players see, which is useful if it advertises its own address. Example entrypoint for host mode (GameServer.sh):

#!/bin/bash
exec "$HOME/MyGame/Binaries/Linux/GameServer" MyGame \
-port="$GAMEYE_PORT_UDP_7777" \
-QueryPort="$GAMEYE_PORT_UDP_27015" \
"$@"

Using exec makes the game server the container’s main process, so it receives the stop signal directly when a session ends.

See Container environment variables for every variable Gameye sets, such as the session’s region and host IP.


Build, run the container locally to check that the server starts, then push:

Terminal window
docker build --platform linux/amd64 -t mygame/server:build-001 .
docker run --rm -p 7777:7777/udp mygame/server:build-001
docker push mygame/server:build-001

With the webhook in place, the push registers the new tag with your application and Gameye starts pulling it onto nodes.

  • Use a new tag for every build, such as a build number or git commit SHA. Nodes that already have a tag don’t download it again, so re-pushing an existing tag (including latest) doesn’t deliver your new build.
  • Keep images lean. Smaller images reach nodes faster. Follow Docker’s best practices for building images.

With your image on Docker Hub, continue with either: