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.
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.
Pulling gitlab ... done
We will stop the outdated container.
docker container stop gitlab
And finally update it but do not start yet.
docker-compose up -d --no-start
3) Restore Config Backup
When the container is recreated the configuration files will be recreated as well.
Restore the whole configuration backed up folder.
4) Start the Container
Let's start our updated container.
docker container start gitlab