Docker for game servers

I’m about to take my game server and throw it in a docker container and try Google’s Container Service and I was wondering if anyone had advice/experiences doing the same that might be helpful. Amazon and Azure also have container services so I’ll try those as well for 30 days.

For those unfamiliar with Docker it’s basically a way of creating a image based virtual machine that only contains your application and it’s dependencies, which runs in it’s own environment on a host machine. So multiple docker containers can run on the same host and be isolated from each other, but share the hosts’s kernel and other OS services.

What I like about this as opposed to PaaS solutions like App Engine is you are not tied to a hosting providers predefined environment or APIs. For instance my game server uses websockets and websockets are not supported in AppEngine which is mainly REST focused. If I end up not liking Google’s service I just ship my docker container over to Azure or whoever and my server environment is exactly the same as it was on my PC at home. If I port a AppEngine server I need to rewrite it to support the new PaaS providers API and environment. Also if you want to run a Unity server that would obviously require something like Docker or a fullblown VM anyways.

You might say - well why don’t you just get a virtual machine on a hosting provider? The answer to that which I can vouch for from personal experience is - do you want to be a sysadmin or a developer? VM’s require patching, updating, monitoring, etc. Containers sit “in the cloud” and you deal with no OS related drudgery, while still maintaining a custom environment for your app that previously you had to have a real VM for. You still take advantage of cloud services like autoscaling instances of your app, load balancing, etc.

This was a long way of asking if anyone has had positive experiences deploying their game servers this way and if they had a particular provider they recommend.

Do they actually have the windows docker working yet?.. I thought it was still beta/alpha kinda thing. I was looking at it too for hosting Kestrel.

I’ve only deployed on Linux but according to their website they do have a stable Windows one now.

The timing on this is kind of funny with the announcement of Plus. This would be a guaranteed money maker cloud service if Unity offered a easy way to package up your game in a docker image and hosted it for you. Then they could sell integrations like Unet matchmaking/relay that sit in the same datacenter and have low latency to the server.

Docker makes some things easier, it doesn’t save you from knowing sys admin stuff. You need more knowledge here not less actually using docker.

I will say stick with linux if you can, don’t use the MS containers and docker. It might be ok for unity instances as unity is self contained, but for more complex stuff automating installation of dependencies can be a huge pain. MS has these big software suites like visual studio where you often need just some part of it for an application, say the MS build tools. But these things are often buggy and broken, don’t install correctly, it’s just a freaking nightmare to automate installation of this stuff via docker.

I’ve used pretty much every deployment tool out there on both linux and windows in production environments. My advice on docker is generally wait until you have around 5+ servers to manage. Otherwise just use something like octopus deploy + topshelf on windows, or say capistrano on linux. Windows is more of a pain but it’s really simple to configure a server on almost all linux cloud providers and then just image it and boot up X more. Docker is not a win at 1 server, it’s a win somewhere past that, and what that number is varies.

1 Like

Can you elaborate on why it is not a win at 1 server?(although I plan on scaling to at least 4 or 5) I’m not seeing how building a dockerfile off a standard base image is more complex than managing a full VM. The time it takes me to setup the dockerfile is extremely minimal and I can query it’s logs/status via the cloud command line tools that they provide through their SDKs without ever logging into a host.

It is a win… or will be. It would seem that as the next windows server has container support, you’ll be able to (or in theory) quickly deploy a container to hyper-v, which could easily be delivered to azure or other docker hosts(?). I think it is too early to know for sure, but scalability wouldn’t be the limit as long as you designed it right.