themattman/mongodb-raspberrypi-docker

Set timezone for mongodb raspberrypi docker image

Closed this issue · 3 comments

The timezone is not set which makes the log output be two hours off. I want to have it configured, but have no clue about how to do this with the docker-image provided.

I’ve tried setting TZ=Europe/Paris in the docker-compose which have worked for other docker use cases but it does not seem to work for this one.

I figured this should be a quite common use case? But didn’t find anything when searching...

I can't distribute an image for each timezone :) but I want to make sure it's easy to configure.

Do any of these suggestions work?
https://stackoverflow.com/questions/57607381/how-do-i-change-timezone-in-a-docker-container

if tzdata package is installed, i can try.

When tzdata is installed during the building phase of the docker image you can use the env variable "TZ=Europe/Paris". It's working for me. I'm using mongodb with unifi controller.