Docker: Allow setting timezone via configuration parameter

Created on 16 Jan 2015  路  4Comments  路  Source: jenkinsci/docker

It would be awesome if you allow passing in a configuration parameter when starting the docker container in order to set the time zone. Reading out the time zone from the host might not be always sufficient e.g.:

If your Jenkins instance is running in a different location than the user's (for example: the server is in NY but users are in LA), then the NY time zone will most probably be used, which may be quite annoying if you need to compare build dates.
https://wiki.jenkins-ci.org/display/JENKINS/Change+time+zone

An implementation similar to GITLAB_TIMEZONE would be great.

Most helpful comment

It is also possible to override the docker container timezone by appending the following volumes:
-v /etc/timezone:/etc/timezone -v /etc/localtime:/etc/localtime

All 4 comments

Found now an alternative way to set the timezone via

docker run ... -e JAVA_OPTS=-Duser.timezone=UTC

But a configuration solution as in Docker Gitlab would be nice and maybe more intuitive. What do you think about that?

Nice to know: As timezone you can set also e.g. Europe/London instead of UTC

+1

Thanks @subesokun I was wondering about this and your solution works. Wonder if there's a nicer way. What does the configuration solution for Docker Gitlab look like?

It is also possible to override the docker container timezone by appending the following volumes:
-v /etc/timezone:/etc/timezone -v /etc/localtime:/etc/localtime

Was this page helpful?
0 / 5 - 0 ratings

Related issues

greenrobot picture greenrobot  路  7Comments

manoj150283 picture manoj150283  路  3Comments

mpv945 picture mpv945  路  7Comments

fboudra picture fboudra  路  4Comments

arthurvanduynhoven picture arthurvanduynhoven  路  3Comments