Run Gitlab and Gitlab CI on a Raspberry Pi 3 Model B+ with Docker !
This project is proudly offered to you by Virtua SA.
- Get a Raspberry Pi 3 Model B+ (but it should works with RPi 2B (64b) and 3B too)
- Flash a Raspbian image on it
sudo raspi-config
- Configure your WiFi, enable SSH, allow only 16MB of RAM for the GPU ...
curl -sSL https://raw.githubusercontent.com/virtua-sa/gitci314/master/install | bash
It takes up to 30 minutes to run Gitlab for the first time. Also, first access to Gitlab may be very slow but it improves greatly after few requets. So it might be a good idea to take a good cup of chocolate/coffee/tea while reading what Virtua SA can do for you or looking for your next job opportunity during the process ;)
Warning: SSH port of your Raspberry Pi will be changed from 22 to 2022 to allow Git over SSH.
- Because Gitlab consumes a lot of RAM, this setup uses a 6GiB swap file
- In aim to increase the lifespan of your Raspberry Pi SD card, you should move this file to an USB drive with :
SWAPFILE=/dev/sdaX ./install
or after the installation with:./install-swap 6 /dev/sdaX
- In aim to increase the lifespan of your Raspberry Pi SD card, you should move this file to an USB drive with :
- If you have an intensive use of Gitlab CI runners or if you have security concerns regarding your data, you should move the Gitlab Multi Runner image to another Raspberry Pi
- In aim to have more space for your Git projects, move the shared folders to an external USB drive (see
docker-compose.yml
file) - Of course, this setup MUST NOT be used for production purpose. It is mainly a proof of concept and should be used as is.
- Simply open the URL
http://<your_raspberrypi_ip>
in your favorite browser then set a new password forroot
account
-
Grab the registration token of your Gitlab here:
http://<your_raspberrypi_ip>/admin/runners
-
Run following command on your Raspberry Pi:
docker-compose run runner register \ --executor "docker" \ --docker-image "resin/rpi-raspbian:stretch" \ --url "http://gitlab/" \ --description "Docker Runner" \ --tag-list "docker,rpi" \ --run-untagged \ --locked="false"
Notes: you can use default settings, but make sure to provide your registration token when asked. If you get a timeout error from Docker, rerun the command.
Warning: if you run Gitlab and the gitlab-runner on the same Raspberry Pi, you may encounter issues with the
docker
executor, so you should use only theshell
executor instead. -
Restart the runner:
docker-compose restart runner
docker-compose gitlab run update-permissions
This project is published under the terms of the Apache 2.0 licence.
This project uses ideas and some portions of code taken from gitlabhq/omnibus-gitlab.