How to update docker datetime and timezone in Discourse

Last updated on April 21st, 2020 at 04:03 am

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

Tags:

Discover more from Juzhax Technology

Subscribe now to keep reading and get access to the full archive.

Continue reading