Introducció
When you configure CI/CD, you specify an image, which is used to create the container where your jobs run. To specify this image, you use the image
keyword.
You can specify an additional image by using the services
keyword. This additional image is used to create another container, which is available to the first container. The two containers have access to one another and can communicate when running the job.
The service image can run any application, but the most common use case is to run a database container.
You’re not limited to only database services. You can add as many services you need to .gitlab-ci.yml
or manually modify the config.toml
. Any image found at Docker Hub or your private container registry can be used as a service.
Services inherit the same DNS servers, search domains, and additional hosts as the CI container itself.
Postgres
As many applications depend on Postgres as their database, you have to use it to run your tests.