This document is about: FUSION 1
SWITCH TO

Docker Image

Level 4

Overview

The Fusion Dedicated Server Docker Image Sample is a set of scripts and files showing how a Fusion Dedicated Server can be enveloped into a Docker Container and executed in a Docker environment.

The Docker platform is a well known virtualization system build around the concept of containers, a group of "virtual machines" running a set of particular applications, properly setup and enclosed, being able to be created and destroyed at will, without the need worry about process isolation and which OS the host machine is using.

When dealing with the creation of Dedicated Servers, the use of containers is one of the best solutions and most game server hosting providers accomplish their scalability precisely by the use of Docker underneath.

Download

Version Release Date Download
1.0.2 Nov 20, 2024 Fusion Dedicated Server Docker Image 1.0.2 Build 733

File Description

  • README.md: contain general information about how to build and use the sample.
  • Dockerfile: the container description, a configuration file used by Docker when building the Docker Image. The Fusion Game Server will be executed from the Linux Container by the fusion user. More info about Dockerfile here.
  • bin/entrypoint.sh: script that will execute the Fusion Game Server and optionally parse the arguments passed to the container to the server binary.
  • run_server.sh: reference script of how to run the container with optional arguments.

How to Run

This sample should only be used as reference and may need some modifications to suit more complex scenarios.
It does not show how to orchestrate the Game Servers, only how to run it using a Docker Container.

Setup Docker

  1. Go to docker.com/get-started.
  2. Install and setup your Docker Service.

Preparing the Fusion Server for a Docker Image

  1. Based on the Fusion Dedicated Server sample.
  2. Build a the Dedicated Server:
    • Set Linux as the Target Platform and x86_64 as Architecture.
    • Check the Server Build flag.
    • Set the executable name to server.x86_64.
  3. Copy all the build files to the bin folder.

Create the Fusion Server Docker Image

  1. Open a terminal on the current folder.
  2. Make sure the Docker service is running in your system.
  3. Run: docker build -t <your_custom_image_name> .
    • Example: docker build -t fusion-dedicatedserver .
  4. A new Docker Image with the name fusion-dedicatedserver will be created on your local repository.

Run the Fusion Server as a Docker Container

  1. Open a terminal on the current folder.
  2. Make sure the Docker service is running in your system.
  3. Run: docker run -d -p <host_custom_port>:27015/udp <your_custom_image_name>
    • Example: docker run -d -p 27015:27015/udp fusion-dedicatedserver
    • By default, the Fusion Dedicated Server will bind to port 27015, and this port is already exposed by the Docker image (check the Dockerfile). Running the command above, that port will be mapped to the host 27015 port as well.
    • Running a detached Container (-d argument) makes it run independently of the current terminal.

Optional Start Arguments

The Fusion Server Docker Image is prepared to accept the same arguments as the standalone build accepts. However, they have different argument names, because how the entrypoint.sh script read those.
Check the argument list below for more info:

  • -s <custom_session_name>: Use a Custom Session ID Name. Default: Random GUID Session Name
  • -r <custom_region>: Connect the Server to a Custom Region. Default: Best Region
  • -l <custom_lobby>: Join a Custom Lobby. Default: Join the Default ClientServer Lobby.
  • -i <custom_public_ip>: Set a Custom Public IP of the Server. Default: Empty, the Server will use the STUN Service to discover its Public IP.
  • -p <custom_public_port>: Set a Custom Public Port of the Server. Default: Empty, the Server will use the STUN Service to discover its Public Port.

Check the run_server.sh script for a more structured way of starting a new Fusion Server Container using the optional arguments. Example:

sh

docker run -d -p 27015:27015/udp fusion-dedicatedserver -s my_session -r eu -l my_lobby

Invoking this will start a Fusion Game Server using the Session Name my_session on Region eu and the Session will be listed on Lobby my_lobby.

Back to top