2. Create and push your Dockerfile
1. Create your Dockerfile
Section titled “1. Create 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 serverRUN useradd -m gameuser
# copy your server files, owned by that userCOPY --chown=gameuser:gameuser . /home/gameuser/MyGame/RUN chmod +x /home/gameuser/MyGame/GameServer.sh
USER gameuser
# start the game serverENTRYPOINT ["/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:
docker build --platform linux/amd64 -t mygame/server:build-001 .2. Choose your network mode
Section titled “2. Choose your network mode”You pick the network mode when you create the application. It decides how your server finds the port players connect to.
| Bridge | Host | |
|---|---|---|
| How ports work | Your 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 conflicts | None: each container has its own network namespace | Your server must use the assigned port, or it can collide with other containers |
| What your server must do | Nothing: listen on the container port you configured | Read its port from an environment variable at startup |
| Overhead | Small overhead from Docker’s port mapping | None |
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.
Port environment variables
Section titled “Port environment variables”Gameye passes every assigned host port to the container as an environment variable, in both modes:
GAMEYE_PORT_{PROTOCOL}_{CONTAINER_PORT}| Variable | Meaning |
|---|---|
GAMEYE_PORT_UDP_7777 | The host port players use for container port UDP 7777 |
GAMEYE_PORT_TCP_8080 | The 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/bashexec "$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.
3. Build and push your image
Section titled “3. Build and push your image”Build, run the container locally to check that the server starts, then push:
docker build --platform linux/amd64 -t mygame/server:build-001 .docker run --rm -p 7777:7777/udp mygame/server:build-001docker push mygame/server:build-001With the webhook in place, the push registers the new tag with your application and Gameye starts pulling it onto nodes.
Tagging rules
Section titled “Tagging rules”- 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.
Next step
Section titled “Next step”With your image on Docker Hub, continue with either:
- Set up the Admin Panel: create your application, load a tag and start a test container from the web UI.
- Start with the API: start your first session programmatically.