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

Dynamic starry sky background implemented with CSS3

Result:Implementation Code html <link href=...

MySQL 5.7 installation-free configuration graphic tutorial

Mysql is a popular and easy-to-use database softw...

Detailed explanation of meta tags (the role of meta tags)

No matter how wonderful your personal website is,...

Native js implements a minesweeper game with custom difficulty

This article example shares the specific code of ...

Summary of problems encountered when installing docker on win10 home version

Docker download address: http://get.daocloud.io/#...

jQuery realizes the effect of theater seat selection and reservation

jQuery realizes the effect of theater seat select...

Solution to transparent font problem after turning on ClearType in IE

The solution to the transparent font problem after...

Detailed explanation of grep and egrep commands in Linux

rep / egrep Syntax: grep [-cinvABC] 'word'...

Jenkins builds Docker images and pushes them to Harbor warehouse

Table of contents Dockerfile pom.xml Jenkins Conf...

Why is UTF-8 not recommended in MySQL?

I recently encountered a bug where I was trying t...

Web Design: Script Materials Reconstruct User Experience

<br />Original text: http://blog.rexsong.com...

Use of JavaScript sleep function

Table of contents 1.sleep function 2. setTimeout ...

Practical method of deleting associated tables in MySQL

In the MySQL database, after tables are associate...

MySQL 8.0.11 Installation Tutorial under Windows

This article records the installation tutorial of...