Table of Contents

Gitlab

The current installation is under: http://gitlab.wialon-consulting.de:8080/

Start

A wrong method to start the Gitlab container:

sudo docker logs -f gitlab

The container will start. After that press Ctrl+C to exit the log.

At the moment I don't know a better method to start the container ⇒ search for it.

Note (05.05.2023):

sudo docker start gitlab

worked too… I don't know why it was not possible previously. Maybe something goes wrong, but I didn't seen it?

Backup

I made backup with the help of this document: https://docs.gitlab.com/ee/raketasks/backup_restore.html

The command was: sudo docker exec -t gitlab gitlab-rake gitlab:backup:create

Also I've copied the /dockerdata/gitlab/config directory to ~/gitlab.bak/config.

Restore

I've used the following document: https://docs.gitlab.com/ee/raketasks/backup_restore.html#restore-gitlab

So:

# Stop the processes that are connected to the database
sudo docker exec -it gitlab gitlab-ctl stop puma
sudo docker exec -it gitlab gitlab-ctl stop sidekiq
 
# Verify that the processes are all down before continuing
sudo docker exec -it gitlab gitlab-ctl status
 
# Run the restore. NOTE: "_gitlab_backup.tar" is omitted from the name
sudo docker exec -it gitlab gitlab-backup restore BACKUP=1637386323_2021_11_20_14.4.2
 
# Restart the GitLab container
sudo docker restart gitlab
 
# Check GitLab
sudo docker exec -it gitlab gitlab-rake gitlab:check SANITIZE=true

Upgrade

I made upgrade with the following document: https://docs.gitlab.com/ee/install/docker.html#update-gitlab-using-docker-engine

1. I made a backup (see above)

2. I stopped the running container:

sudo docker stop gitlab

3. I removed the container:

sudo docker rm gitlab

4. I pulled the new image:

sudo docker pull gitlab/gitlab-ce:latest

5. Then I created the new container with the following command:

sudo docker run --detach \
--hostname gitlab.wialon-consulting.de \
--publish 8443:443 --publish 8080:80 --publish 1022:22 \
--name gitlab \
--restart always \
--volume $GITLAB_HOME/config:/etc/gitlab \
--volume $GITLAB_HOME/logs:/var/log/gitlab \
--volume $GITLAB_HOME/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest

Unfortunately I couldn't upgrade directly to the latest version, so it was necessary to upgrade major versions:

sudo docker pull gitlab/gitlab-ce:12.0.0-ce.0
 
# then stop container, remove container, create new container, then pull new version ...
 
sudo docker pull gitlab/gitlab-ce:13.0.0-ce.0
 
# ... then run it again

Installed versions

Misc

Big log file

Gitlab creates a big log file in the current container:

So it is necessary to remove this file regularly (possible only as root):

sudo -s
cd /var/lib/docker/containers/992bd1257242f4e8ac5288959bf5e0a822afd7813e470b4bc48f614e22b931b7
rm 992bd1257242f4e8ac5288959bf5e0a822afd7813e470b4bc48f614e22b931b7-json.log

Other command which can be useful is du (disk usage):

# disk usage of all directories and files in current directory
du -sh ./*
 
# disk usage of a specific directory
du -sh directory_name

Gitlab configuration

The gitlab configuration is in file: /dockerdata/gitlab/config/gitlab.rb

At the moment I've changed only prometheus configuration:

prometheus['enable'] = false

Also interesting info about cleaning of prometheus data: https://forum.gitlab.com/t/clear-up-postges-prometheus-data/38216