For the complete documentation index, see llms.txt. This page is also available as Markdown.

Docker & Containers

Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly.

Why use Docker?

Working in a team of developers means sharing your code. When things go wrong, the last thing you want to hear is “it works on my machine”. Game servers have to run reliably on any machine, since a successful games’ servers will run on thousands of server machines across the world.

To help make your server reliable, we use Docker - virtualization software to ensuring that all of your server code dependencies down to the operating system level are going to be always exactly the same, no matter how or where the server is launched.

We recommend watching "Never install locally" (video). You DON'T need to use Dockerhub with Docker. Docker ≠ Dockerhub. Think of Docker as a programming engine and Dockerhub as it’s App Store.

Containers

A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. Containers isolate software from its environment and ensure that it works uniformly despite differences for instance between development and staging.

Once you run packaged docker images, they become:

  • Containers if running in Docker Desktop or Docker Engine (usually locally),

  • Deployments if running on Edgegap (both Edge Cloud and Private Fleet).

A container runs natively on Linux (or in Docker desktop) and shares the host machine's kernel with other containers. It runs a discrete process, taking no more memory than any further executable, making it lightweight.

Try it Out

To use docker and build or run docker images locally, you'll need to install Docker:

Install Docker Desktop (or Docker CLI)

Once installed, you can open your terminal of choice and try running a test image.

This will automatically perform the following steps:

  1. Download the speedtest image from Edgegap Repository (only the first time).

  2. Create and start a new container using this image on your machine.

  3. Assign the name "speedtest" (using --name parameter).

  4. Expose a Port Mapping to connect your machine's port 80 to the container's port 80 , enabling access to the container from your machine.

✅ Open http://localhost:80 in your preferred browser to confirm the container started OK.

With a Container running, we can perform basic interactions - restart, stop, monitor.

First, let's see what is running on your docker engine using your preferred terminal.

This will print information about running containers, for example:

You can have any number of containers running.

Let's try to get more information about your container:

You can also inspect the network shared between your machine and the containers.

This will print information about the network ran by docker engine on your machine.

You can also inspect individual networks closer:

Once you're done with testing the container, make sure to stop it to regain the resources (CPU and RAM) which the container was using to run:

SSH tunnel

To troubleshoot server issues in depth, you can expose the SSH service in your images and connect to the container or deployment just the same as any remote host or a VM.

Test Locally

We'll need to make some modifications to your Dockerfile. Let's install OpenSSH service, create a user with a password, and enable the service.

Merge these Dockerfile commands in your Dockerfile:

EXPOSE doesn't automatically publish ports, it's a hint for docker engine and developers.

We'll also need to start the ssh service in the container:

✅ Now docker build, and test docker run locally, then test with ssh localhost:22.

Deploy in Cloud

If you didn't succeed with Test Locally, you can test in a Deployment environment.

✅ Log in to your docker registry and docker push the new tag:

✅ Create a new testing app version for this image through dashboard.

  • Add a port mapping for 22/TCP to mirror the -p option from docker run.

✅ Deploy and use the URL or IP with the external SSH port assigned to ssh.

✅ Once you're done testing, stop the deployment and delete your testing image.

Last updated

Was this helpful?