Allow user to define command and entrypoint to services from config
What does this MR do?
Allow user to define command and entrypoint to services from config
Why was this MR needed?
Users can define services right inside of the config.toml
. They can
only define the name
and alias
of the service. When using services
inside of the gitlab-ci.yml
they can define entrypoint
and
command
,
however they can't do this inside of the config.toml
file.
What's the best way to test this MR?
Docker
-
Have the following
.gitlab-ci.yml
.gitlab-ci.yml
image: docker:19.03 variables: DOCKER_TLS_CERTDIR: "/certs" DOCKER_HOST: "tcp://docker:2376" DOCKER_CERT_PATH: "/certs/client" DOCKER_TLS_VERIFY: 1 build: stage: build script: - echo $DOCKER_HOST - docker info
-
Have the following
config.toml
config.toml
[[runners]] ... [runners.docker] image = "alpine:3.12" privileged = true volumes = ["/cache", "/certs/client"] [[runners.docker.services]] name = "docker:19.03.13-dind" command = ["--registry-mirror", "https://mirror.gcr.io"]
-
You should see the
https://mirror.gcr.io
is used for the docker mirror fromdocker info
command
Kubernetes
-
Have the following
.gitlab-ci.yml
.gitlab-ci.yml
image: docker:19.03 variables: DOCKER_TLS_CERTDIR: "/certs" DOCKER_HOST: "tcp://docker:2376" DOCKER_CERT_PATH: "/certs/client" DOCKER_TLS_VERIFY: 1 build: stage: build script: - echo $DOCKER_HOST - docker info
-
Have the following
config.toml
config.toml
[[runners]] ... [runners.kubernetes] image = "alpine:3.12" privileged = true [[runners.kubernetes.volumes.empty_dir]] name = "docker-certs" mount_path = "/certs/client" medium = "Memory" [[runners.kubernetes.services]] name = "docker:19.03.13-dind" alias = "docker" entrypoint = ["dockerd-entrypoint.sh"] command = ["--registry-mirror", "https://mirror.gcr.io"]
-
You should see the
https://mirror.gcr.io
is used for the docker mirror fromdocker info
command
What are the relevant issue numbers?
- Closes #27173 (closed)
- Merge request in main GitLab docs to document this as well: gitlab!46538 (merged)
Edited by Steve Xuereb