[original notes] one of cicd series: installing gitlab

Time:2021-12-7

One of cicd series: installing gitlab

Prepare host: 10.0.0.14

1. Turn off the firewall and SELinux

systemctl stop firewalld

systemctl disable firewalld

sed -i ‘s/enforcing/disabled/’ /etc/selinux/config

setenforce 0

2. Install docker

3. Install docker compose

Download the docker compose component for your current Linux version

sudo curl -L “https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose

Add execution permission

sudo chmod +x /usr/local/bin/docker-compose

View docker compose version

docker-compose –version

4. Build gitlab private warehouse (using built-in PostgreSQL and redis)

mkdir -p /home/disk1/gitlab
mkdir -p /home/disk1/gitlab/{config,data,logs}
cd /home/disk1/gitlab && vi docker-compose.yml


version: ‘3’
services:

gitlab:
  container_name: gitlab
  image: 'twang2218/gitlab-ce-zh:11.1.4'
  restart: unless-stopped
  hostname: 'dev-poc'
  environment:
    TZ: 'Asia/Shanghai'
    GITLAB_OMNIBUS_CONFIG: |
      external_url 'http://dev-poc:10101'
      gitlab_rails['time_zone'] = 'Asia/Shanghai'
      gitlab_rails['gitlab_shell_ssh_port'] = 22
  ports:
    - '10101:10101'
    - '443:443'
    - '2222:22'
  volumes:
    - ./config:/etc/gitlab
    - ./data:/var/opt/gitlab
    - ./logs:/var/log/gitlab
        
    

5. Local domain name

echo “10.0.0.14 dev-poc” >> /etc/hosts

6. Start

docker-compose up -d
docker-compose ps

7. Visitshttp://10.0.0.14: 10101 and change the root user password