website logo
⌘K
What is Gameye?
Getting started
Getting ready to start
1. Set up your Docker Hub account
2: Set up your organization on Gameye
3. Sort and push your Docker file
4. Configure your ports
5. Start the API call
API
API endpoints
Regions and locations
Error handling
Guides
Integrations
Using Gameye
Working with Docker
Support
Getting support
Giving feedback
Troubleshooting
Troubleshooting problems
FAQs
How do I start using Gameye?
Do you require authorisation to use the API?
How does Gameye scale?
What is the difference between a location and a region?
Is Gameye free to use?
FAQs
Glossary
Docker
Container
Region
Image Registry
Bare metal
Flex metal
Cloud
Matchmaker
Changelogs
Docs powered by
Archbee
Getting started

3. Sort and push your Docker file

8min

1: Create your Docker file

Someone in your team will have to code your Docker file. This should only take about ten minutes as it’s fairly straightforward. But you’ll need to test this with your game binary, which can take some time to get right.

Your Dockerfile should contain either ENTRYPOINT or something similar that the user you’ve created will launch. Make sure everything is correct, otherwise it’ll cause issues when starting the container.

Here’s a code block you can use as a template. It’s a basic Dockerfile that will work for most situations.

Dockerfile
|
FROM ubuntu:20.04

# copy your server files here
# for example:
COPY . /home/MyGame/

# add user to run the container
RUN useradd -m gameuser

# set permissions
RUN chmod 777 /home/MyGame/GameServer.sh

USER gameuser

# set your game binary as the entrypoint
ENTRYPOINT ["/home/MyGame/GameServer.sh", "-log"]

# add port number(s) needed for your game
EXPOSE 1024/udp
EXPOSE 7777/udp


This base image should do the trick. But if you need something more specific or advanced, it might be better to create the container from scratch.

Your networking method might affect the file

Depending on the networking method you pick in the next step, you might need to change your Dockerfile. For now, here are a couple of examples:

Bridge networking Docker file:

Dockerfile
|
FROM ubuntu:focal

#copy server files
COPY . /home/MyGame/

RUN useradd -m gameuser

# set permissions
RUN chmod 777 /home/MyGame/GameServer.sh

USER gameuser

ENTRYPOINT ["/home/MyGame/GameServer.sh", "-log"]

EXPOSE 1024/udp
EXPOSE 7777/udp


Host networking Dockerfile:

Dockerfile
|
FROM ubuntu:focal

#copy server files
COPY . /home/MyGame/

RUN useradd -m gameuser

# set permissions
RUN chmod 777 /home/MyGame/GameServer.sh

USER gameuser

ENTRYPOINT ["/home/MyGame/GameServer.sh", "-log"]


Entrypoint:

Shell
|
#!/bin/sh
UE4_TRUE_SCRIPT_NAME=$(echo \"$0\" | xargs readlink -f)
UE4_PROJECT_ROOT=$(dirname "$UE4_TRUE_SCRIPT_NAME")
chmod +x "$UE4_PROJECT_ROOT/MyGame/Binaries/Linux/GameServer"
"$UE4_PROJECT_ROOT/MyGame/Binaries/Linux/GameServer" MyGame $@ -port=7777 -GameServerQueryPort=1024


2: Push your new Docker image to Dockerhub

Now that everything is packaged together as an image, push it to Dockerhub. This is a good time to test if everything works by using our sandbox environment.

Why hasn’t the server been updated? It might just need some time. Keep in mind, a 5GB image takes up to three minutes for the server to download and extract. So give it a moment or two.



Updated 22 Jun 2023
Did this page help you?
PREVIOUS
2: Set up your organization on Gameye
NEXT
4. Configure your ports
Docs powered by
Archbee
TABLE OF CONTENTS
1: Create your Docker file
Your networking method might affect the file
Bridge networking Docker file:
Host networking Dockerfile:
Entrypoint:
2: Push your new Docker image to Dockerhub
Docs powered by
Archbee