Pages: [1]
  Print  
Author Topic: Docker image for an OpenArena 0.8.8 server  (Read 3750 times)
sago007
Posts a lot
*

Cakes 61
Posts: 1645


Open Arena Developer


WWW
« on: June 01, 2016, 03:29:12 pm »

For the past month or so I have been looking into Docker and the ability to make a container that are just ready to go.

I have created such an image for an OpenArena server.

If Docker is installed the following command:
Code:
docker run -it -e "OA_STARTMAP=dm4ish" -e "OA_PORT=27960" --rm -p 27960:27960/udp -v openarena_data:/data sago007/openarena:1.0.8.8.1

will launch an OpenArena 0.8.8 server with a sane default configuration.
The mounted data directory can be redirected to a folder where you can adjust the configuration to your need.
For people that understand Docker this can be considerably quick compared to using the long description on the wiki.
It can also be turned into a daemon by replacing "-it" with "-d --restart=always"

The full description can be read on Docker hub:
https://hub.docker.com/r/sago007/openarena/

There was multiple OpenArena servers on Docker Hub but this is specialized for 0.8.8 compared to the others that are more standard Quake 3 like. However remember that being standard Q3 like is a good thing if you want to host a mod.
Logged

There are nothing offending in my posts.
Gig
In the year 3000
***

Cakes 48
Posts: 4224


WWW
« Reply #1 on: June 02, 2016, 06:32:08 am »

What about adding some kind of intro about what "Docker" is?
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
sago007
Posts a lot
*

Cakes 61
Posts: 1645


Open Arena Developer


WWW
« Reply #2 on: June 02, 2016, 01:50:47 pm »

Forgive me.

Two months ago I did not understand what Docker was. But after working with it an afternoon I suddenly believed it was the answer to all my prayers.

I have read a lot of descriptions of what Docker is and none of them made any sense...

I would describe a Docker image as a virtual machine image that you will never execute as a virtual machine. Instead docker will open the image and start a single program inside the image. Furthermore the image is only as isolated as you want it to be. Want to map a directory into it? You can. Want to open a network port? You can. And it is well documented witch ports to open and which directories you should map.
It can be hard to argument to people that does not setup servers why this is good but take a look at how to setup an OpenArena server: http://openarena.wikia.com/wiki/Servers

It involves multiple steps:
 * upload OA to your server: this can be done via ftp, ssh/scp or whatever you prefer
 * create an OA user account
 * get / create a server config file
* Setup firewall (not currently automatic with docker image although it may be in future)
 * run the server and make sure it stays active when you log out

All these steps are now just one command (assuming that Docker is installed).

The description on http://openarena.wikia.com/wiki/Servers can be hard to follow. So can the steps here: https://hub.docker.com/r/sago007/openarena/~/dockerfile/
However the steps in the Docker file are tested and you can be sure that you get the the same default configuration and user setup that I already verified to work.

You could also see the process like this:
1. Download the source
2. Setup build dependencies
3. Build it
4. Setup run dependencies
5. Run it
6. Configure it
Downloading makes you skip to step 4. Using a docker image let you skip to step 6.

There is more. It has been a long time since I created fresh binaries for OpenArena. Docker images can also contain a full build environment. It is sometimes hard to describe a build environment. Not long ago there was an issue on github where the build instructions was incomplete (https://github.com/OpenArena/engine/pull/7). This can be solved with a build server and we have Travis but a Docker image takes it a step further. Everyone can fetch the Docker image and build it on there own machine. The steps may be different on Travis and on your machine but the Docker image is the same. "It works for me" is such a lame argument but it is a lot better if we all use a consistent image.
Logged

There are nothing offending in my posts.
Gig
In the year 3000
***

Cakes 48
Posts: 4224


WWW
« Reply #3 on: June 06, 2016, 01:26:45 am »

Interesting.
For the moment, I added a few lines here:
http://openarena.wikia.com/wiki/Servers#Linux

By the way, I haven't yet understood whether Docker is free. On its site, I read "open source".... I can find a "Pricing" section, but not a "Download" one (maybe just because it may be easily downloaded from Linux repos?).
« Last Edit: June 06, 2016, 01:34:17 am by Gig » Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
sago007
Posts a lot
*

Cakes 61
Posts: 1645


Open Arena Developer


WWW
« Reply #4 on: June 06, 2016, 10:32:24 am »

Docker can be installed on both Windows and Mac. The Windows installation instructions are here: https://docs.docker.com/engine/installation/windows/
I have not tried running it under Windows yet. I might try it on my laptop however Windows is installed on a harddrive that I must first swap in and it involves 9 screws.

It can also be build from source but building it from source is easiest from the source building image.

I have only tried Docker on Linux. The Windows and Mac cheats by installing Oracle VM VirtualBox and running Linux in the background.

The whole container thing is rapidly changing and there are other options than Docker. Docker appears to be ahead at the moment, at least in the amount of users.
Logged

There are nothing offending in my posts.
Gig
In the year 3000
***

Cakes 48
Posts: 4224


WWW
« Reply #5 on: June 07, 2016, 02:06:36 am »

Is this way okay, then?
http://openarena.wikia.com/wiki/Servers#Using_Docker
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
sago007
Posts a lot
*

Cakes 61
Posts: 1645


Open Arena Developer


WWW
« Reply #6 on: June 07, 2016, 10:14:49 am »

Good work!
Logged

There are nothing offending in my posts.
Gig
In the year 3000
***

Cakes 48
Posts: 4224


WWW
« Reply #7 on: June 07, 2016, 10:22:05 am »

Thank you!  Smiley

By the way, I think I should say "good work" to you... I can guess learning Docker and preparing a container is harder than writing a few text lines and placing a few links in a wiki page. Smiley
« Last Edit: June 07, 2016, 10:48:57 am by Gig » Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
pelya
Member


Cakes 6
Posts: 395


WWW
« Reply #8 on: June 07, 2016, 02:00:55 pm »

I've just tried Docker, it's basically like an app from portableapps.com, where you copy an app .exe file to your USB drive and can launch it from this USB drive on any PC, with no .dll dependencies and no data directories.
Or like a portable chroot image on Linux.
I'm not sure you can run this image on Windows, did you put Windows executables inside, Sago?
The only issue is that the image is hidden somewhere in /var/lib/docker so it's not easy to modify it.
Logged
Gig
In the year 3000
***

Cakes 48
Posts: 4224


WWW
« Reply #9 on: June 08, 2016, 03:02:49 am »

I'm not sure you can run this image on Windows, did you put Windows executables inside, Sago?
Uhm... I may be wrong, but considering that installing Docker Toolbox on Windows requires a VirtualBox Virtual Machine where Docker Engine will run inside Linux, I can guess the whole thing can only be used with Linux programs, unless using tricks like Wine.

With a very quick google search I found:
https://github.com/monokrome/docker-wine (A Docker container with Wine)
https://github.com/webanck/docker-wine-steam (A Docker container with Wine and Steam)
« Last Edit: June 08, 2016, 03:06:29 am by Gig » Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
sago007
Posts a lot
*

Cakes 61
Posts: 1645


Open Arena Developer


WWW
« Reply #10 on: June 08, 2016, 04:33:01 am »

Docker only runs Linux and only on 64 bit systems. Therefore the Docker image is based on a 64 bit Debian 8. It only contains oa_ded.x86_64. All other are removed by create_docer_internal_script.sh. The script is executed by the Dockerfile.

I've just tried Docker, it's basically like an app from portableapps.com
I better way to describe it. I always had problems explaining Docker and for a long time I ignored it because all the people explaining it could not explain its purpose.

I'm not sure you can run this image on Windows, did you put Windows executables inside, Sago?
Windows uses an actual virtual machine.

The only issue is that the image is hidden somewhere in /var/lib/docker so it's not easy to modify it.
It is true that it is hard to modify directly. You need to add another layer using the Docker tools. But that is simple and because all the changes must be applied to a new image layer it is easier to reproduce. Running "docker build -t oa_test ." takes just a few seconds. Sometimes less options gives more flexibility.
Logged

There are nothing offending in my posts.
Pages: [1]
  Print  
 
Jump to: