Configure GitLab CI for Dockertest
v4When running in GitLab CI with shared runners, use the docker:dind service. Set DOCKER_HOST to tcp://docker:2375 and DOCKER_TLS_CERTDIR to "".
Important: In your pool.Retry callback, use the environment variable (e.g., $YOUR_APP_DB_HOST) instead of localhost to connect to the database, as the database will be available on the host named docker.
# GitLab CI snippet
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
YOUR_APP_DB_HOST: docker