bareos icon indicating copy to clipboard operation
bareos copied to clipboard

Wrong timezone within container

Open Flunkyball opened this issue 1 year ago • 2 comments

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

Flunkyball avatar Apr 07 '23 09:04 Flunkyball

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 !

barcus avatar May 15 '23 20:05 barcus

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.

grapemix avatar Sep 11 '23 00:09 grapemix