My experience with Docker

Niall Deakin
01 Feb 19

I run my own home server

It’s a powerful enough little machine.

Currently is runs Ubuntu 18.04, on an Intel Celeron Dual processor, 8GB RAM and 500GB 2.5″ HDD.
What does all that mean?  Nothing, really.  Just wanted to share it.

The main reason I got this machine is to host my own repos for all the work I do.  Version control is such a lifesaver in the work I do, and it can store a whole arrange of different information.  I use it to store my web work, and my game work, and it makes it easier to work on different computers.

But I’m sure that’s for another post.

Around Christmas time, 2018, I was thinking about growing the business’s infrastructure, and looking at hosting my own “Office” software; I found OnlyOffice, which is a G Suite/Office 365 alternative.  I was really excited at this prospect, being able to host and control all my own resources, but there was one issue I faced from the off-set; I only had the one server.

This is where Docker came in

What Docker does is create Containers which act like their own mini-server, similar to how virtual machines work.
Essentially you can quickly spin up a Container with whatever you need and start working on it, you can even have multiple containers running at the same time.

So this is what I’d try to do with my home server, use Docker to host my repos and my office.

Except it’s that not that straight forward

The thing with Docker is that it uses a whole bunch of different ports, and it isn’t so straight forward to get the ports to play well with one another.

I am used to using physical machines, with their own IPs, ports, and whatever else, so when I am shoe-horned into using a shared IP:Port situation, and those ports not being the default, it irks me most troublesome (read: It really annoys me).
That’s why I enjoyed running dev sites on VirtualBox, because it was like have my own server there.  I guess that is essentially like a VPS.

This ultimately led me down the rabbit hole of finding a way to share ports, or just host multiple containers.

Let me introduce Compose

Compose (or Docker Compose for the sake of argument) is essentially a way to set all container configuration into a file, so rather than typing it all out, etc., you put it all into a YML file and just tell Compose to run that.  It’s very handy and I did indeed fall in love with it, when I got it to work.

This also helped a great deal with sharing ports, running multiple “sites”, and for a while I thought it would answer all my problems.

But after 2/3 months of pure struggle, I decided to give up; why?  It ultimately wasn’t worth the hassle.

The biggest caveats

The main reason I tried all this was to run multiple services from one machine.  I wasn’t expecting it to be such a hassle as “I’ve done this type of thing before”.  It was a great learning experience, and perhaps I’ll come back to it, but the main reasons were simply the port situation, and the dynamic IP.

I like to use SSH, and I couldn’t directly tunnel into a container from my desktop PC, which is what I like to do.  There were some forum posts about how to do this, like creating a special user which does this, blah blah, but I had spent so much time wasted on this, repeating the same stuff and even having to rebuild the server several times.  From that, I think I’ve learnt I bought a dodgy SATA cable (not impressed).

But none of that compares to the fact that every so often, my IP changes.  The joys of not being able to have a static IP.  It’s kinda essential to running a server.
Without a static IP, I’d have to manually change the IP address of the apps and services whenever it changed, and that just isn’t on.

OpenVPN to the rescue

Except, not.

I thought that I could run a cheap VPS (costing like $2 USD per month) to be my VPN server, and have my home server tunnel into that.
It took a while, following some guides and tutorials (which rarely work IMO) and I managed to tunnel into the VPN server from my Desktop, but not my server… and I never could.

I also ended up needing to run my own Certificate Authentication server, so that doubled the cost.

So my quick fire, low-cost solution just wasn’t going to work.

What am I doing now?

So I’ve gone back to the basics, even more so.  I’ve got my server set up as previously stated, and running GitLab CE (well technically EE, but that’s the Omnibus for you).

I’m only using one HDD, as before I was running RAID10, but again, that was just a hassle.  I’ve got 1TB of storage, so I don’t think I’ll run out any time soon.

I am still using G Suite Free, as I’ve been using it for years, and TBH, it’s very useful.  I may return to the OnlyOffice option later on in life, as and when I need it (and have the resources available), but as I am still focusing on growing my business, where I am at right now suits me just perfectly.

Perhaps one day I will employ people and need a more robust infrastructure.
Luckily I enjoy SysAdmin.

Containers, Docker, NginX, Servers