Install Gitlab Ce Docker



Ok, I see there’re three volumes mounted in the Gitlab container, it’s good. Update docker version of Gitlab. Exactly the same procedure as the official one. I will update the current gitlab-ce:10.8.3-ce.0 to gitlab-ce:latest. Pull the new image: To pull other version, change the lastest by the tag name which can be found from the docker hub. That is, all you really need to do is to install Docker and change a couple of things in the GitLab config and everything happens like magic. The Set-Up We assume that you have a self-hosted GitLab EE site somewhere, accessible by gitlab.example.com. We assume that this is on an Ubuntu (16.04) machine. Sudo systemctl enable docker gitlab-runner sudo systemctl restart docker gitlab-runner Use the Gitlab Runner in your jobs. When you want to use your runner, you can either add docker to the tags section of your.gitlab-ci.yml. Or you can configure the Gitlab CI runner to be used for any job. Hi, you’ll need to create your own image which is based on CentOS 7 then. This can be used in the docker-compose setup then as different image entry. Since the Docker image recommended in the docs is officially supported and tested, I would suggest to keep using it, instead of going your own route.

  1. Install Gitlab Ce Docker Compose
  2. Install Gitlab Ce Docker Windows

Gitlab-CE (Community Edition) is a completely free and powerful web-based Git-repository manager with wiki, issue-tracking and CI/CD pipeline features, using an open-source license, developed by GitLab Inc. There’re already many much better docs on the net, I’ve never worked with Docker and Linux before, so I wrote this post to save my way to install the Gitlab docker version on Ubuntu, the post is more or less for personal purpose.

Install Gitlab Ce Docker
  1. Enabled the free Hyper-V role on the Windows 10 PC.
  2. Install Ubuntu server on the Hyper-V. (I used “Ubuntu 18.04.1 LTS”)

Warning: Don’t install the snap version of Docker during the Ubuntu install, I failed to run the Docker image after. There’s an error saying that: “docker: Error response from daemon: error while creating mount source path ‘/srv/gitlab/logs’: mkdir /srv/gitlab: read-only file system.”. To remove the Docker snap: sudo snap remove docker.

Here is the official doc for installing Docker on Ubuntu, just follow the procedure step by step.

Docker

The docker group is created but no users are added to it. You need to use sudo to run Docker commands. Continue to Linux postinstall to allow non-privileged users to run Docker commands and for other optional configuration steps.

To verify Docker is running fine, we can try to run a hello-world image :

Here is the official Gitlab Docker doc, I really thank the Gitlab team, their doc system is one of the bests that I’ve ever seen. Another doc from IBM is also good. Run the following commands to install Gitlab-CE in Docker.

Warning: I use --publish 2222:22 instead of --publish 22:22 which is given by the official Run the docker image doc, this is to avoid using the default SSH port (TCP 22) already binded to the Docker host, our Ubuntu server.

Warning: Do NOT use port 8080 otherwise there will be conflicts. This port is already used by Unicorn that runs internally in the container.

GitlabInstall

Note: There’s also a Docker compose way to install Gitlab-CE.

Install Gitlab Ce Docker Compose

Open your browser, go to http://YourUbuntuServerIP/, you should see the Gitlab login page. On this page, you need to set the Gitlab root user initial password.

If you like to use HTTPS, you need to generate a SSL certificate and add it to Gitlab the config file.

Install Gitlab Ce Docker Windows

IBM has provided a doc about it.