Specifying environment variables for Gitlab CI services

I want to connect a Rails application to an mssql db running in a docker container. Locally, I start this container with the following command

docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Password123' -p 1433:1433 -d microsoft/mssql-server-linux

However, with you specify a service in a .gitlab-ci.yml file you do the following

  - microsoft/mssql-server-linux

This does not allow me to specify the ACCEPT_EULA=Y and SA_PASSWORD=Password123 environment variable the container needs to order to start correctly.

Can someone please advise on how I can get these env variables defined for the service so that it can start-up properly?

Having the same issue :frowning: @BrandonMathis did you come up with a solution? Or anyone else?

Found the solution myself. Apparently one can “just” specify these environment variables. See for example: https://docs.gitlab.com/ce/ci/services/mysql.html

I’ve made a ticket for this: https://gitlab.com/gitlab-org/gitlab-ce/issues/50248