barcus / bareos

Docker image for Bareos
https://hub.docker.com/r/barcus
MIT License
119 stars 57 forks source link

Wrong timezone within container #168

Open Flunkyball opened 1 year ago

Flunkyball commented 1 year ago

Hello,

Iam running the latest container of bareos-director and added in the compose file the following volumes in order to get time and timezone in sync with the host system:

  - "/etc/localtime:/etc/localtime:ro"
  - "/etc/timezone:/etc/timezone:ro"

However, the container still is running UTC time and therefore backups are started on the clients 2 hours later than scheduled due to the wrong timezone.

What is the proper procedure in your setup to correct that ?

Thx, Ludwig

barcus commented 1 year ago

Hello Ludwig, This is the good way to setup your own timezone i think 👍 Maybe it should be added by default in all compose file !

grapemix commented 1 year ago

I can confirmed that the package tzdata is being installed in 21-alpine, so we can just set an env var called TZ and we can get local time in the box.

On the other hand, images like fd and sd don't have tzdata installed, so mounting /etc/timezone won't help getting the local time in the box. So adding tzdata inside the Dockerfile is a good idea.