The docs for gitlab's container registry (https://gitlab.com/help/container_registry/README.md) provide a config example with this instruction:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.example.com
and this explanation:
You have to use the credentials of the special gitlab-ci-token user with its password stored in $CI_BUILD_TOKEN in order to push to the Registry connected to your project. This allows you to automated building and deployment of your Docker images.
I cannot find any documentation about this special gitlab-ci-token
user, nor about the $CI_BUILD_TOKEN
var.
What is this special user? Is it automatically available? Does it have to be defined somewhere? What value should be given to the $CI_BUILD_TOKEN
var?
Gitlab acts as an authentication provider for the registry.
gitlab-ci-token
is a user automatically created for you.CI_BUILD_TOKEN
is set automatically for each build by Gitlab-CI