Storing code in GitLab’s container and package registries for later deployment
GitLab’s package and container registries are useful not only for making software available for users to download but also for storing packages and libraries for use in CI/CD pipelines, or for deployment to an environment. In this section, we will discuss how to programmatically interact with the registries via CI/CD jobs.
Using images from the container registry
In the previous section, we built a containerized version of our app and pushed the image to GitLab’s container registry. Recall that the CI/CD jobs we used to build the container image themselves run in containers, hence the reference to terms such as docker:stable
and docker:dnd
. In this example, we are pulling from a public container registry, that is, Docker Hub.
However, we can also pull container images we have pushed to GitLab’s container registry and use them as the basis for running our CI/CD jobs. We...