Detailed tutorial on using Docker to build Gitlab based on CentOS8 system

Detailed tutorial on using Docker to build Gitlab based on CentOS8 system

1. Install Docker

#1. Uninstall the old version yum remove docker \
    docker-client \
    docker-client-latest \
    docker-common \
    docker-latest \
    docker-latest-logrotate \
    docker-logrotate \
    docker-engine
    
#2. Download the required installation package sudo yum install -y yum-utils

#3. Set up a mirrored warehouse. It is recommended to use Alibaba Cloud's yum-config-manager, which is very fast.
    --add-repo \
    http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    
#4. Update the yum package index yum makecache

#5 Install the latest version of containerd.io
dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
	
#6. Install docker-related content docker-ce community edition ee enterprise edition sudo yum install docker-ce docker-ce-cli --allowerasing

#7. Start Docker
systemctl start docker

#8. Determine whether the docker version is started successfully 

image-20210930141611884

2. Install GitLab

Official Documentation

①. Create a new container data volume folder

mkdir /data/gitlab/config -p
mkdir /data/gitlab/logs -p
mkdir /data/gitlab/data -p

②Run GitLab container

docker run --detach \
  --hostname localhost \
  --publish 4443:443 --publish 8880:80 --publish 2222:22 \
  --name gitlab \
  --restart always \
  --volume /data/gitlab/config:/etc/gitlab \
  --volume /data/gitlab/logs:/var/log/gitlab \
  --volume /data/gitlab/data:/var/opt/gitlab \
  gitlab/gitlab-ee:latest 

image-20210930141527798

Tracking and viewing logs

docker logs -f gitlab

③. Optimize memory usage. If the configuration is high enough, you can skip the optimization.

Because we mounted the container data volume, we can modify the configuration file directly on the host.

vim /data/gitlab/gitlab.rb

Ⅰ. Change memory limit settings

Uncomment

image-20210930152720351

II. Reduce database cache

256 changed to 128

image-20210930153533878

III. Reduce the number of concurrent databases

8 changed to 4

image-20210930153643236

④. Access test

Open firewall ports

firewall-cmd --zone=public --add-port=8880/tcp --permanent
firewall-cmd --zone=public --add-port=4443/tcp --permanent
firewall-cmd --zone=public --add-port=2222/tcp --permanent

View the local ip

ip addr 

image-20210930153800231

Visit http://192.168.225.128:8880

image-20210930153821513

3. Initialize GitLab

①. Login

Log in as root user and view the password:

docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password 

image-20210930154505130

Login successful, go to personal homepage to change password

image-20210930162025461

②、Create a project

Select Internal as the permission level, so that everyone except external users can access it.

image-20210930162310547

③. Install Git

yum install git
git version 2.27.0

④. Pull Project

git clone http://localhost:8880/root/customproject.git 

image-20210930162948174

⑤. Test and push changes to remote

cd customproject/touch test.txtgit add test.txtgit commit -m 'test push'git push origin main 

image-20210930163426788

image-20210930163443779

⑥. Create your own account

After registration, log in to the administrator account, enter the personal homepage, click the little man in the upper right corner, enter the user interface, and then approve the newly registered user.

image-20210930164501637

Click the project you just created, click Members , and invite the user you just created.

image-20210930164727950

This is the end of this article about using Docker to build Gitlab based on CentOS8 system. For more relevant content about building Gitlab with Docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Teach you the detailed process of using Docker to build the Chinese version of gitlab community
  • Two ways to build a private GitLab using Docker
  • Methods and steps for deploying GitLab environment based on Docker
  • Detailed tutorial on building Gitlab server on CentOS8.1
  • How to build gitlab on centos6
  • Centos7 uses docker to build gitlab server
  • How to build gitlab using Docker example
  • Steps to build your own private GitHub repository with GitLab
  • Detailed explanation of using docker to build gitlab
  • Build a local GitLab server on CentOS7

<<:  Analysis and solution of the reasons for left and right jumps when loading web pages

>>:  N ways to align the last row of lists in CSS flex layout to the left (summary)

Recommend

HTML design pattern daily study notes

HTML Design Pattern Study Notes This week I mainl...

Analysis of the Poor Performance Caused by Large Offset of LIMIT in MySQL Query

Preface We all know that MySQL query uses the sel...

Implementing form submission without refreshing the page based on HTML

Using ajax to implement form submission without re...

CSS example code to hide the scroll bar and scroll the content

Preface When the HTML structure of a page contain...

mysql-8.0.16 winx64 latest installation tutorial with pictures and text

I just started learning about databases recently....

Why the explain command may modify MySQL data

If someone asked you whether running EXPLAIN on a...

MySQL max_allowed_packet setting

max_allowed_packet is a parameter in MySQL that i...

In-depth explanation of modes and environment variables in Vue CLI

Preface In the development of actual projects, we...

Complete steps to upgrade Nginx http to https

The difference between http and https is For some...

Detailed explanation of .bash_profile file in Linux system

Table of contents 1. Environment variable $PATH: ...

The problem of Vue+tsx using slot is not replaced

Table of contents Preface Find the problem solve ...

The latest 36 high-quality free English fonts shared

01. Infinity Font Download 02. Banda Font Download...

HTML Basics: The basic structure of HTML

The basic structure of HTML hypertext documents is...