Arch Linux - Docker Node - Updating GitLab Container - ( Part V )
I have revisited my GitLab container recently and noticed that it is asking for an update. Updating a GitLab docker container is relatively easy.
Let's follow GitLab's instructions.
1) Take a Backup
Let's get the GitLab container name.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
xxxxxxxxxxx gitlab/gitlab-ee:latest "/assets/wrapper" 3 months ago Up 27 hours (healthy) gitlab
To backup we need to execute the following command :
docker exec -t gitlab gitlab-backup create
Warning: Your gitlab.rb and gitlab-secrets.json files contain sensitive data
and are not included in this backup. You will need these files to restore a backup.
Please back them up manually.
Backup task is done.
I do not need to worry about the configuration backups because my installation creates a backup daily and I will use the backups to restore.
You should check the current version and follow the upgrade path if upgrading between major versions.
Docker images can use the below to check the current version.
sudo cat /gitlab-data-folder/gitlab/data/gitlab-rails/VERSION
2) Container Update
Before downloading the latest image we need to set the environment variable $GITLAB_HOME
pointing to our installation home folder.
Let's download the latest image.
Make sure that the version is set to latest in your docker-compose.yml
file.
Pulling gitlab ... done
We will stop the outdated container.
And finally update it but do not start yet.
3) Restore Config Backup
If you are not mapping local folders to the container, when the container is recreated the configuration files will be recreated as well. Otherwise, skip to the next step.
Restore the whole configuration backed up folder.
4) Start the Container
Let's start our updated container.
docker container start gitlab