GitLab
Container Registries
Each repo can have it’s own container registry. You can use this to store Docker images relating to the project.
CI_REGISTRY_IMAGE
is provided and is the base path for the container registry.
You can log into the repo’s container registry inside a pipeline with the command:
Then you be able to push a built image:
You can download images from the GitLab container registry to your local machine by first logging in:
You will be prompted to enter your username and password. If you have 2FA enabled, you will have to substitute your password with a personal access token.
You can then download and run an image with:
Includes
You can include files in your .gitlab-ci.yml
file with the include
keyword. This is useful for sharing common configuration between multiple projects.
You can also use the ref
to specify a branch, tag or commit SHA when including a file. This is good for “version control” of your include dependencies.