There are various questions on how to use docker or docker-compose from the gitlab-ci.
So I am using the following Docker-Images for my quest:
- gitlab/gitlab-runner:latest (as the gitlab-runner instance)
- docker/compose:1.29.2 (as gitlab-ci.yml executor image)
- docker:dind (as service)
image: docker/compose:1.29.2
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_HOSTNAME: myhost
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
services:
- name: docker:dind
stages:
- composeTest
composeTest:
stage: composeTest
tags:
- compose
script:
- ping -c 3 docker
- docker-compose --version
- docker-compose up -d
- docker-compose down
Currently I disabled tls, I will work on this later. That is not content of this question!
In this script, the first two commands are successfully processed, but docker-compose up -d
fails when it tries to pull the required images.
On my server I also have a .docker/config.json
file with content like
{
"auths": {
"local.artifactory.corp.net": {
"auth": "VERY SECURE KEY!"
}
},
"proxy": {
"remoteurl": "local.artifactory.corp.net"
}
}
I figured, I need this config.json available in the docker-container, that pulls the required images.
- But which of the three afforementioned containers is it?
- (How) can I get it there? (Without maintaining a custom version of it?)