How to access host environment variables in CI scripts

Hi guys,

I’ve been trying to deploy an application with docker-compose, but I need to access an environment variable defined in the host (/etc/environment) and it doesn’t seem to work when I run it with the Gitlab runner. The command correctly finds the variable if I run it directly inside the machine.

Does the runner somehow clean the environment before running any commands? How can I access host system-wide defined variables?

Best regards,

Clara