How to update docker datetime and timezone in Discourse

I found that the date inside docker is different with the host machine. You can check the date by using this way.

[root@server discourse]# docker exec app date
Mon 20 Apr 2020 08:38:36 PM UTC
[root@server discourse]# date
Tue Apr 21 04:12:39 +08 2020
[root@server discourse]#

Solution to update the date

[root@server discourse]# cd /var/discourse
[root@server discourse]# ./launcher enter app
[root@server discourse]# mv /etc/localtime /etc/localtime.backup
[root@server discourse]# ln -s /usr/share/zoneinfo/EST5EDT localtime
[root@server discourse]# date

Now the date is correct


Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.