Runner doesn't respect Timezone settings when set to Pacific/Auckland
Summary
When timezone set to Pacific/Auckland
, date should print out NZST time, but it still prints UTC time
Steps to reproduce
- Run following script on runner host:
sudo ln -sf /usr/share/zoneinfo/Pacific/Auckland /etc/localtime
- Get NZST time by running following command on host machine
[root@xxx xx]# date
Thu Sep 19 14:22:12 NZST 2019
- Register gitlab-runner with docker executor and bind
/etc/localtime
in docker volume - Run the following job
debug:timezone:
only:
- merge_requests
stage: stage 1
tags:
- debug
script: "date"
.gitlab-ci.yml
debug:timezone:
only:
- merge_requests
stage: stage 1
tags:
- debug
script: "date"
Actual behavior
Actually get UTC time as
Thu Sep 19 02:22:12 UTC 2019
Expected behavior
Expect to get NZST time as
Thu Sep 19 14:22:12 NZST 2019
Relevant logs and/or screenshots
job log
Running with gitlab-runner 12.2.0 (a987417a)
on Debug runner xxx
Using Docker executor with image docker:stable ...
Pulling docker image docker:stable ...
Using docker image sha256:b40e5afd78f53c1f0591358707e06ee7ca2778291dc53864fc1195fc7f3a011a for docker:stable ...
Running on runner-xxx-project-30-concurrent-0 via ip-xxx.ap-southeast-2.compute.internal...
Fetching changes...
Reinitialized existing Git repository in /builds/xxx/repo/.git/
...
Checking out cfc41728 as refs/merge-requests/315/head...
Skipping Git submodules setup
Thu Sep 19 01:16:16 UTC 2019
Job succeeded
Environment description
config.toml contents
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "Debug runner"
output_limit = 20000
url = "xxx"
token = "xxx"
executor = "docker"
[runners.custom_build_dir]
[runners.docker]
tls_verify = false
image = "docker:stable"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/srv/cache:/srv/cache:rw", "/etc/timezone:/etc/timezone:ro", "/etc/localtime:/etc/localtime:ro", "/cache"]
wait_for_services_timeout = 120
shm_size = 0
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
Used GitLab Runner version
Version: 12.2.0
Git revision: a987417a
Git branch: 12-2-stable
GO version: go1.8.7
Built: 2019-08-22T13:06:00+0000
OS/Arch: linux/amd64
Possible fixes
Edited by Hao