Container environment variables
Gameye injects a set of environment variables into every running container. Read them from your entrypoint script or game server process to discover where the session is running, which ports are mapped, and how to identify the container in your own systems.
For port configuration during onboarding, see Networking mode affects the Dockerfile.
Built-in variables
Section titled “Built-in variables”| Variable | Description | Example |
|---|---|---|
GAMEYE_REGION | Region where the session is running | eu-central-1 |
GAMEYE_APPLICATION | Application name (the image field in API calls) | my-game-server |
GAMEYE_IP | Host IP address that clients connect to | 203.0.113.42 |
GAMEYE_CONTAINER | Unique container (session) identifier | c595bc6f-8522-4a62-95cd-8742136643ea |
GAMEYE_ORGANIZATION | Organization that owns the session | my-studio |
These variables are always present. You do not need to pass them when creating a session.
Port variables
Section titled “Port variables”Port variables are created for each port exposed by your application. The name follows a fixed prefix plus the protocol and container port:
GAMEYE_PORT_{protocol}_{containerPort}| Variable | Meaning |
|---|---|
GAMEYE_PORT_UDP_7777 | Ephemeral host port mapped to UDP 7777 inside the container |
GAMEYE_PORT_TCP_80 | Ephemeral host port mapped to TCP 80 inside the container |
With host networking, your entrypoint must read these variables at startup and pass the resolved port numbers to your game server. With bridge networking, the orchestrator maps ports automatically from your EXPOSE directives — port variables are still available if your server needs to advertise them.
Ingress port variables
Section titled “Ingress port variables”When ingress routing is enabled for your application, Gameye also injects externally reachable port numbers using this pattern:
GAMEYE_INGRESS_PORT_{protocol}_{containerPort}| Variable | Meaning |
|---|---|
GAMEYE_INGRESS_PORT_UDP_7777 | Externally reachable UDP port for container port 7777 |
GAMEYE_INGRESS_PORT_TCP_80 | Externally reachable TCP port for container port 80 |
Use GAMEYE_INGRESS_PORT_* when you need the port clients reach through Gameye’s ingress layer. Use GAMEYE_PORT_* for the host-level mapping inside the container’s networking context.
Legacy variable names
Section titled “Legacy variable names”Older integrations may still reference these names. Gameye continues to inject them alongside the current names for backward compatibility. Prefer the current names in new code.
| Legacy name | Current name |
|---|---|
GAMEYE_SESSION_ID | GAMEYE_CONTAINER |
GAMEYE_HOST | GAMEYE_IP |
GAMEYE_IMAGE | GAMEYE_APPLICATION |
Example entrypoint
Section titled “Example entrypoint”#!/bin/bash"$UE4_PROJECT_ROOT/MyGame/Binaries/Linux/GameServer" MyGame \ -sessionName=$GAMEYE_CONTAINER \ -port=$GAMEYE_PORT_UDP_7777 \ -GameServerQueryPort=$GAMEYE_PORT_UDP_1024 \ "$@"
status=$?if test $status -eq 0; then echo "Server exited normally"else echo "Server exited with code: $status"fiNot the same as user-defined variables
Section titled “Not the same as user-defined variables”Gameye injects the variables above automatically. They are separate from values you pass when creating a session:
| Mechanism | How to set | Purpose |
|---|---|---|
| Built-in variables (this page) | Injected by Gameye at container start | Runtime identity, networking, and placement |
env field on POST /session | Your API request body | Custom configuration for your game server (e.g. MAX_PLAYERS) |
labels field on POST /session | Your API request body | Arbitrary metadata for filtering and correlation in your own systems |
The labels.env field returned by session API responses reflects the built-in variables available inside the container. See Using container labels for how labels are structured.