Getting started
3. Sort and push your Docker file
6min
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 https //docs docker com/engine/reference/builder/ should contain either entrypoint https //docs docker com/engine/reference/builder/#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 https //docs docker com/engine/reference/builder/ that will work for most situations 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 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 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 \#!/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