I’m working with Gitlab-Runner in a Docker Container on MacOS recently.
I run the containers with the following command:
docker run -d --name gitlab-runner --restart always -v /Users/Shared/gitlab-runner/config:/etc/gitlab-runner -v /var/run/docker.sock:/var/run/docker.sock -e TZ=Europe/Berlin gitlab/gitlab-runner:latest
The runner is working fine and the registration to our Gitlab-Project worked, too.
However I discovered a little issue regarding the time. I set the Timezone for this container to match my local time, but if I start a pipeline I noticed that another additional container gets started (named “runner----andsoon”) who does the actual job in running the pipeline. The problem seems to be that the timezone is wrong in this additional runner container and therefore the build time differs from the local time. This is not that much of a problem technically but not nice If the built time differs for some hours. Is there a way to configure the gitlab-runner container to start this additional containers with the correct timezone? Since it gets named and started dynamically I can’t use “docke run -e”.
Thanks in advance and regards