Install GitLab on CentOS 8 with no internet connection

I wrote Article to introduce GitLab to CentOS 7 before, and after maintaining it, I also tried to introduce GitLab with CentOS 8.3 + podman, so make a note. Well, Jenkins works fine as in the previous article and has no problems.

What I'm aiming for is that Docker images are less portable than I expected (Reference), so when I build an OpenShift 4 cluster on-premise, I need to prepare the DevOps environment of RHEL8 + podman. After all, if you are not connected to the Internet, you will have a hard time shit.

environment

Prepare a virtual machine in an environment without internet connection. 2 CPUs, 4GB of memory, 20GB of HDD. The OS is CentOS 8.3. With minimal installation. Start from the place where you can set the IP address and connect with ssh.

In the explanation, the IP address of the CentOS server is "192.168.0.116" and the host name is "devops.example.com".

Install podman

    1. Mount the CentOS installation DVD with the ISO connected to the virtual machine.
# mount /dev/cdrom /media
    1. Create a repo file.
# rm -f /etc/yum.repos.d/*
# cat > /etc/yum.repos.d/media.repo << 'EOF'
[media-baseos]
name=CentOS Linux 8 - Media - BaseOS
baseurl=file:///media/BaseOS
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

[media-appstream]
name=CentOS Linux $releasever - Media - AppStream
baseurl=file:///media/AppStream
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
EOF
    1. Install podman.
# yum install -y podman

Install GitLab

    1. Get the GitLab Docker image from Docker Hub. Pull the image of GitLab-CE on a PC with an internet connection and Docker installed, and save. https://hub.docker.com/r/gitlab/gitlab-ce/tags This time 13.7.3-ce.0. The tar file is about 2.1GB.
# docker pull gitlab/gitlab-ce:13.7.3-ce.0
# docker save gitlab/gitlab-ce:13.7.3-ce.0 > gitlab.tar

Copy the obtained gitlab.tar to your CentOS 8 machine.

I have Windows connected to the Internet, but I don't have Docker? In that case, there is an option to use a tool called graboid on the premise that even if a virus is mixed in, it will be crap. You see, the installation destination is not connected to the Internet! https://github.com/blacktop/graboid

    1. Load the GitLab Docker image.
# podman load -i gitlab.tar
    1. Start GitLab. Unlike docker, podman doesn't automatically create a mount directory for you.
# mkdir -p /srv/gitlab/{config,logs,data}
# podman run --detach \
  --hostname devops.example.com \
  --env GITLAB_OMNIBUS_CONFIG="external_url 'http://devops.example.com/'" \
  --publish 443:443 --publish 80:80 \
  --name gitlab \
  --restart always \
  --volume /srv/gitlab/config:/etc/gitlab:Z \
  --volume /srv/gitlab/logs:/var/log/gitlab:Z \
  --volume /srv/gitlab/data:/var/opt/gitlab:Z \
  gitlab/gitlab-ce:13.7.3-ce.0
  1. Refer to the GitLab container log and wait for GitLab to start. Internally, it reconfigures itself with Chef after starting the container, and it takes a few minutes at the first start.

When the message "Chef Infra Client finished," is displayed, it seems that the configuration is complete, but the log flows too quickly and it is difficult to recognize. If you think that the green line has stopped being output for a while, I think it's done.

# podman logs -f gitlab

Visit GitLab

    1. Modify the/etc/hosts file (or C: \ Windows \ system32 \ drivers \ etc \ hosts) of the accessing PC, add the following line and save.
192.168.0.116 devops.example.com
    1. Open a web browser and access the following URL. Note that TLS is not configured this time, so if you connect via HTTPS, it will not connect in reverse. http://devops.example.com
    1. When you access for the first time, you will be asked to set an administrator password, so enter the password and click "Change your password".
  1. On the sign-in screen, specify the user name as "root" and the password as the character string set earlier, and then click "Sign in". If done well, "Welcome to GitLab" will be displayed. image.png

bonus

The source file committed to the GitLab repository is stored in the `` `/ srv/gitlab/data``` specified above, so if GitLab suddenly stops starting, refer to that as a direct repository. And the materials can be collected.

# git clone ssh://[email protected]/srv/gitlab/data/git-data/repositories/\@hashed/d4/73/d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.git/
# ls d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35.git
hello.txt

Recommended Posts

Install GitLab on CentOS 8 with no internet connection
Install NextCloud on CentOS 7 with Alibaba Cloud ECS
Install Golang on CentOS 8
Install Neo4j 4.1.3 on centOS
Install PostgreSQL 12 on Centos8
Install nginx on centOS7
Install kuromoji on CentOS7
Install Mattermost on CentOS 7
Install PostGIS 2.5.5 on CentOS7
Install jpndistrict on CentOS 7
Install Redmine 4.1.1 on CentOS 7
Smokeping Install on CentOS7
Install PostgreSQL 13 on CentOS 7.5
I want to create a Servlet war file with OpenJDK on CentOS7. Without mvn. With no internet connection.
Network install CentOS 8 with Kickstart.
Install Jenkins on Docker's CentOS
Install Apache on CentOS on VirtualBox
Install Ruby 2.7 on CentOS 7 (SCL)
Note: Install nginx from official repositories with dnf on CentOS 8
Install Ruby on MSYS2 with pacman
Try DPDK20 SDK on CentOS7 â‘ Install
Install Java with zip on Windows
Install Ruby 2.5 on CentOS 7 using SCL
Install Java Open JDK 8 on CentOS 7
How to install MariaDB 10.4 on CentOS 8
Install apache 2.4.46 from source on CentOS7
Steps to install MySQL 8 on CentOS 8
Steps to install devtoolset-6 on CentOS 7
Check your internet connection with Alamofire
Install ruby on Ubuntu 20.04 with rbenv
Install Java 9 on windows 10 and CentOS 7
Install samba4 from source code on CentOS8
Set up ImpressPages 5.0 with LAMP on CentOS 7.3
Install the webmail client Rainloop on CentOS 8
Install Java8 with Yum on Amazon Linux
Personal tips on working with CentOS servers
Install CentOS 7 on Raspberry pi 4 Model B
Command to install nginx / PHP7 / php-fpm on CentOS7
Note Book: OpenCV with CUDA Install On Windows10
Install Java 14 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Install CMS Made Simple v2.2.2 on LAMP on CentOS 7.3
Install MariaDB (CentOS 8)
[CentOS] Install apache-loggen
OpenVPN on CentOS 8
CentOS7 SSH connection
Install BookStack Documentation Wiki on Elastic Compute Service on CentOS 7
Install the latest hardware drivers from ELRepo on CentOS
Create a user with an empty password on CentOS7
Install Java 8 (OpenJDK: Zulu Community) on macOS with Homebrew
Install rbenv with apt on ubuntu and put ruby
I struggled with pip install on an M1 Mac
Install MySQL 5.6 on CentOS6 [How to specify the version]
Install ag (the silver searcher) [on CentOS / Ubuntu / Mac]