Skip to content

Allow setting environment variables for build containers in docker executor config

Description

It's not possible to define environment variables to be passed to all builds run by the executor.

As an example, the following does not allow using the DOCKER_HOST variable in build scripts:

[[runners]]
...
environment = [
        "DOCKER_HOST=tcp://my_docker_host:2376",
        "DOCKER_CERT_PATH=/etc/ssl/private/docker/",
        "DOCKER_TLS_VERIFY=1"
    ]
  [runners.docker]
  ...

Proposal

Either make the environment entry apply to the builders (which is the expected behavior IMO) or add a environment entry to the runners.docker section.

Edited by 🤖 GitLab Bot 🤖