I have setup gitlab runner to make use of the docker/compose:latest image to run a set of services.
By setting pull_policy="if-not-present" in the config.toml the docker/compose:latest image is cached and not pulled each time.
How can I set the docker service used in the test stage to use cached images (i.e. those being started using docker-compose up -d )? I'm a bit confused by the dind service.
.gitlab-ci.yml
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
DOCKER_DRIVER: overlay2
CI_REGISTRY: my-docker-registry.local:5000
image:
name: docker/compose:latest
services:
- name: docker:dind
command: ["--insecure-registry=my-docker-registry.local:5000"]
test:
stage: test
script:
- docker-compose up -d
/etc/gitlab-runner/config.toml as follows:
concurrent = 1
check_interval = 0
[[runners]]
name = "user1"
url = "http://gitlab.example.local/"
token = "<MYTOKEN>"
executor = "docker"
[runners.docker]
extra_hosts = ["my-docker-registry.local:192.168.1.100"]
tls_verify = false
tls_verify = false
image = "docker:latest"
privileged = true
disable_cache = false
pull_policy="if-not-present"
volumes = ["/certs/client", "/cache"]
disable_entrypoint_overwrite = false
oom_kill_disable = false
shm_size = 0
[runners.cache]