emqxarchive / emqx-docker

This repository is no longer maintained, please go to https://github.com/emqx/emqx-rel/tree/master/deploy/docker
Apache License 2.0
235 stars 162 forks source link

Set timezone via environment variable #48

Open David-Development opened 6 years ago

David-Development commented 6 years ago

Missing feature

The EMQ dashboard displays the current time in different locations. Therefore being able to set the timezone would be a nice feature.

Workarounds

I forked the repo and added the tzdata package. This allows the user to set the TZ environment flag (tested with docker-compose). Additional image size: 1.45MB

Changes made: https://github.com/David-Development/emq-docker/commit/d1a2b00be6a4d0904ee2419b1d049422341c3643

RaymondMouthaan commented 6 years ago

Hello @David-Development,

emq-docker is alpine based and has two files related to timezone and localtime, these are located at:

Just map your host files to these and it should work: As an example:

$ docker run -it -e /etc/localtime:/etc/localtime -e /etc/TZ:/etc/TZ --name myemqtt emq:lastest

Depends on your host system, but the timezone file could also be named as /etc/timezone instead of /etc/TZ.

Hopefully this fixes your issue.

Regards, Ray

zdf321 commented 5 years ago
  • [ ] BUG REPORT
  • [x] FEATURE REQUEST

Missing feature

The EMQ dashboard displays the current time in different locations. Therefore being able to set the timezone would be a nice feature.

Workarounds

I forked the repo and added the tzdata package. This allows the user to set the TZ environment flag (tested with docker-compose). Additional image size: 1.45MB

Changes made: David-Development@d1a2b00

  • [ ] BUG REPORT
  • [x] FEATURE REQUEST

Missing feature

The EMQ dashboard displays the current time in different locations. Therefore being able to set the timezone would be a nice feature.

Workarounds

I forked the repo and added the tzdata package. This allows the user to set the TZ environment flag (tested with docker-compose). Additional image size: 1.45MB

Changes made: David-Development@d1a2b00

Hello @David-Development, in Dockerfile, line 6, COPY tmp/qemu-$QEMU_ARCH-stati* /usr/bin/,how I find the tmp/qemu-$QEMU_ARCH-stati*? thanks

zdf321 commented 5 years ago

你好 @RaymondMouthaan , 我想在容器中使用CST0800的时间,使用如下命令启动,无效,请帮忙看一下,谢谢 docker run -d --name emqx31 -p 1883:1883 -p 8083:8083 -p 8883:8883 -p 8084:8084 -p 18083:18083 -e /etc/localtime:/etc/localtime -e /etc/TZ:/etc/TZ emqx/emqx:v3.1.0

Rory-Z commented 5 years ago

@1069355234 "-e" in the docker run command sets the environment variable. Do you want to use "-v" to mount the file?