


Mount the volumes of the container to the host machine Set the hostname of the installation to Įxpose the ports 443, 80, 22, and map them to the same ports to the host machine. volume /srv/gitlab/data:/var/opt/gitlab \ volume /srv/gitlab/logs:/var/log/gitlab \ So GitLab will run inside a docker container, but it will use the host machine's disk to save data and load configurations. Installing GitLab as a Docker containerĪfter setting up our Docker installation, the first step towards setting our environment is to run the image of GitLab, using a persistent store inside our host machine. There is a comprehensive walkthrough by Digital Ocean, which applies to any machine with Ubuntu LTS 18.xx installed. Add some gitlab runners using docker and connect them with our GitLab installationĪ prerequisite for following the steps in this post is to have a fully functional Docker installation.Serve GitLab through HTTPS using the host's nginx, using certbot.Install GitLab inside a docker container.

The steps below describe the following process: All we need is Disk and RAM - we can compromise on the CPU since the build time is not mission-critical during CI/CD. GitLab uses too much drive, and for a good reason - apart from your CI/CD, that’s also our Git repo, and build cache. In terms of disk, that’s another field where we need to feel comfortable. If you are building something heavy, you may need more. 40–100MB of additional ram for each runner. GitLab CE running and using Docker - we need 4–6GB RAM for this alone.In Linux, it doesn’t sit upon any virtualization, so it’s going to use the host system’s resources. Here is a non-exhaustive list of what we are going to need to perform our setup: To choose our hardware stack, we need to see what we are going to deploy on this machine. With the following setup, we will be able to perform builds using any technology stack, be it Go-based, NodeJS, Java, etc. We will be using Docker inside a VPS for hosting our GitLab instance, spawning GitLab runners at will when building, and creating Docker images. In this post, we are going to guide ourselves through the initial setup of GitLab using Docker. I am developing both microservices and monoliths, so being flexible with CI/CD is essential for me. The self-hosted GitLab version is virtually limitless. I have chosen the community version of GitLab for my Git and CI/CD needs. If you don't yet have a CI/CD environment, you should consider obtaining one. I have tried many alternatives to test, package, and deploy my solutions when developing. It's very often that I need a deployment environment while developing personal projects. Leverage Gitlab and Docker and use them as a CI/CD infrastructure
