Docker image for building Darkstar on Ubuntu 14.04

Post Reply
dickeyf
Posts: 1
Joined: Sat Feb 16, 2013 1:16 pm

Docker image for building Darkstar on Ubuntu 14.04

Post by dickeyf » Tue Apr 07, 2015 3:38 pm

This is something I've been using for a while and I though people here might benefit from this.

I've built a Docker image that I use to compile Darkstar for Ubuntu 14.04 so I can then install it on my private server. I also use it when I want to tinker in the code, compile, test, rinse and repeat.

The nice thing with a Docker image, is that you can simply get a VPS, EC2 instance, or, heck get an old dusty computer and then install ubuntu 14.04 on it. Once you have your Ubuntu 14.04 server, then all you have to do is install Docker. Once the server is setup and Docker installed, getting to compile Darkstar is only a couple of steps away :

1. cd /home/user/workspace; git clone git clone https://github.com/DarkstarProject/darkstar.git
2. docker run --rm=true -v /home/user/workspace/darkstar:/source dickeyf/darkstar-dev /bin/sh -c "cd /source && sh ./autogen.sh && ./configure LIBS=-lpthread && make -j24"
3. Darkstar should have been compiled!

(Note the :/source, this is important that you leave it untouched. This is because inside the Docker container, the git repository will be mounted at /source)

You don't need to pollute your Ubuntu server with Darkstar dependencies, and also, should any other package be required by Darkstar in the future, I can simply update this docker image, and the all the people using it will benefit from my update.

I believe that other distro of linux with Docker installed on it should also be able to compile Darkstar following the 3 steps above.

This can also be leveraged by Windows users and Mac OS users willing to build for Linux (Should they need Linux binaries for whatever reasons, or simply to ensure they haven't broke the build for Linux). However, boot2docker will be required for this : https://docs.docker.com/installation/windows/


My docker image is here on Dockerhub (But you don't have to go there, as the 3 steps outlined before will pull that image for you) : https://registry.hub.docker.com/u/dickeyf/darkstar-dev/

If you are curious, or want to contribute to this image, then, head over to https://github.com/dickeyf/darkstar-dev fork it, and then submit a pull request.


I am also planning to build a docker images that will encapsulate each Darkstar server binaries (dsgame, dsconnect and dssearch). This image would be kept up to date with the Darkstar git repository. It would then be very easy to deploy Darkstar.

Post Reply