What is the special gitlab-ci-token user?

user1447137 picture user1447137 · May 26, 2016 · Viewed 18.4k times · Source

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?

Answer

Martin picture Martin · May 31, 2016

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