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.
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".
# mount /dev/cdrom /media
# 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
# yum install -y podman
# 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
# podman load -i gitlab.tar
# 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
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
192.168.0.116 devops.example.com
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.
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