How Did I Build Docker Services for My Lab

Recently I have been assigned to build some online services for my Lab such as official wiki, code repository, Piazza… I have physical server machine inmy hand with pretty good hardwares and I want to build and configure these services on the bare machine at first. But the configurations for each service really annoy me and I decide to establish the whole services in another way – Docker.

My OS info is as listed below:

1
2
3
4
5
6
7
8
9
sdic@SDIC:~$ uname -a
Linux SDIC 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
sdic@SDIC:~$ sudo lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu Artful Aardvark (development branch)
Release: 17.10
Codename: artful

It is said:

Docker - Build, Ship, and Run Any App, Anywhere

So I make a list, and build these services step by step.

step 0

Of course the first step must be installing the docker in physical machine. I follow the official guides. However, my networking state seems to be not as good as others(F**K GFW), and it comes up with some problems when I use the docker official repository. After adding the official GPG key, I get 404 connect error after I run apt update, and I have no idea how to deal with it. So I turn to other solution and get the docker installed on my machine.

step 1

Requirement Analysis: The total requirements are as followed:

  1. A website for Lab basic info, like Wiki
  2. A code repository for team collaboration
  3. A forum for students who enroll the courses provided by our Lab (Piazza).
  4. A tool for managing the services’ lifetime, resource, version, backups and so on.

So I explore the docker hub to look for services matched my need. Through carefully comparing, I get another list:

step 2

Decided which services to install, here comes another question: How to manage my docker cluster? This question indicates numbers of aspects in operation and maintenance.

Backup & Recovery

As we know, the docker images run as instances on the machine, each image has its own version. When we want to update the image, how do we deal with the data in the instances? If we just force updating the image and restart the container, all data will be erased. At this point, we need to further understand the docker. Based on my konwledge, the running instance owns a special directory called data volume. It can bypass UFS and

  • shared among the containers
  • mofified immediately
  • isolated from the image
  • persisted even the container being deleted

According to the function of data volume, we can easily create or mount the volume to the container

Start & Stop

Monitoring & Logging

setp 3

Install these services on the machine and configure them. That is least important part, cuz I just refer to the official guidence and follow some advices from the commentary. I still post them out for convenience.

DokuWiki

GitLab

Forum