Skip to content

Container registry

The container registry is the registry where all Docker images are stored for a project. To pull or push an image from a project registry, you need to authenticate your docker application.

Setting access token

To authenticate you need an access_token. You can create a Personal Access Token for your Gitlab account or use an existing Project Access Token if one is available.

To create a personal access token:

  1. On your Gitlab account, go to Preferences > Access Tokens.
  2. Fill in a name to remember the token scope and an expiration date.
  3. Select read_registry and/or write_registry. It is recommended to choose a short expiry date and the minimal scope needed (Gitlab security considerations).
  4. Create and copy the token string somewhere. Once you close or refresh the page, the token will not be available anymore.
  5. Now you can log in using the token as a password with:
Terminal window
docker login <registry_uri> -u <gitlab username> -p <access_token>

For more information: Container registry docs