GoGS on a Pi3 (via Docker)
I’ve been assembling a “full stack”1 for development that runs on my Pi3. This is all happening inside of Docker containers which made cleanup redonkulously easy. Today I was looking at a source code management system; something of a “my own GitHub” which I can run on my own network.
We have GitLab at work; so I wanted something different … also; the authors don’t suggest using a Pi3 for “real.” BitBucket had some (hobbyist?) package for $10, but, it doesn’t support Mercurial2 and also recommends against using a Pi3. Phabricator clearly turns their nose up at the Pi3; next!
I looked at RhodeCode, Kallithea, and then ignored Allura and SCM-Manager since I really didn’t like the way that they looked.
GitBucket was (is) pretty and easy to run, however, it performs poorly on the Pi3.
While looking for PikaCode, I found; Gogs which is now my tool.
Gogs
Gogs is a “belligerently painless” self-hosted git system. It says RaspberryPi and Docker on the front page; I’m in love!
Setup in a Pi3 container went like this;
$ docker pull gogs/gogs-rpi
- this will take awhile; get a coffee
- technically redundant
- we/I want to get this done now AoT to avoid confusion and delays
$ sudo mkdir /var/gogs-pi3
- here
/var/gogs-pi3
is just a host folder that I want GoGS to write to
- here
$ docker create --name=gogs-rpi --restart always -p 3022:22 -p 3000:3000 -v /var/gogs-pi3:/data gogs/gogs-rpi
- here
/var/gogs-pi3
is my earlier host folder /data
is the folder that thegogs/gogs-rpi
image expects to write to; I don’t know/care how to change it. (Sorry)
- here
$ docker start gogs-rpi
I then launched it from portainer and browsed to the new site to set it up. The configurtaion parameters were a bit finicky, I got them to work;
- SQLite database in /data/gogs.db
- correct hostname to reach the Pi3
- set it to use my GMail account through smtp.gmail.com:587 with an Application Password
- setup and admin account for me to use
- didn’t use the built-in SSH-server since that didn’t work quite right
At the moment, I can import a Caffe fork just fine, so I’d say that’s working. There’s an open ticket for Mercurial support but it hasn’t been touched in awhile so … I’m sceptical. The Docker step is really important to me. Being able to pop the whole thing out and discard it from my PC is a critical requirement if I’m going to keep experimenting. I’d really like some sort of Virtual Host system so that I can use the same URL to access the system in and out of my network. An approximation for SSH would also be nice.
Overally; the system is pleasantly responsive - better than the one at work. It’s also clean and easy to navigate. While it lacks a CI thingie; I’m more than happy with Jenkins - so that’s not at all a problem for me.
Going forward; if you/I have to setup a git host for a small business - use this one on a Pi3 with a big hard drive.