Pihole - timezone wrong

Currently reading
Pihole - timezone wrong

Last edited:
I'm trying to setup Pihole in a docker container on my synology. However, I'm having issues to get it to work. I think it has to do with the fact that my timezone in the container (UTC) does not align with my actual timezone (CET).

I tried to get it changed but setting TZ to Europe/Amsterdam does nothing
also exported the docker from synology and adding:

Code:
"volume_bindings" : [
      {
         "host_volume_file" : "/docker/pihole/pihole",
         "mount_point" : "/etc/pihole",
         "type" : "rw"
      },
      {
         "host_volume_file" : "/docker/pihole/dnsmasq.d",
         "mount_point" : "/etc/dnsmasq.d",
         "type" : "rw"
      },
      {
         "host_volume_file" : "/etc/timezone",
         "mount_point" : "/etc/timezone",
         "type" : "ro"
      },
      {
         "host_volume_file" : "/etc/localtime",
         "mount_point" : "/etc/localtime",
         "type" : "ro"
      }

this did nothing, last 2 volumes are not being picked up.

How do I solve this?
 
First of all, there is no /etc/timezone on Synology, instead you must map /etc/TZ to /etc/timezone.
/etc/localtime does exists and indeed needs to be mapped from /etc/localtime to /etc/localtime.

Now here is the catch, the Syno UI only allows volume-bindings for folders that are shares. Either you have to create your container from cli or using Portainer (and don't edit it ever again in the Syno-UI), or you need to create a symlink on one of your shares that point to the files, and use the symlinks instead.
 
Last edited:
so i created some symlinks and adjusted the code like this:

Code:
{
         "host_volume_file" : "/docker/pihole/pihole",
         "mount_point" : "/etc/pihole",
         "type" : "rw"
      },
      {
         "host_volume_file" : "/docker/pihole/dnsmasq.d",
         "mount_point" : "/etc/dnsmasq.d",
         "type" : "rw"
      },
      {
         "host_volume_file" : "/docker/pihole/TZ",
         "mount_point" : "/etc/timezone",
         "type" : "ro"
      },
      {
         "host_volume_file" : "/docker/pihole/localtime",
         "mount_point" : "/etc/localtime",
         "type" : "ro"
      }

the volumes do get mounted now, but if i look in the docker log, I still see that the time is on UTC and not CET. (i also set Environment Variable TZ: Europe/Amsterdam but no impact.
 
Are you talking about the localization inside the container or Synlogy's logs? While the first can be modified, the later will always be UTC.

If a container leverages TZ in its entrypoint script, there is no need to set /etc/timezone and /etc/localtime. The later approach is used for containers that do not have build in TZ support.
 
sorry, was away for a few days. yes, I was talking about the logs that you find in synology. but apparently those cannot be changed. thanks for the help though! second approach is really helpful to know for my other containers as well!
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

Sorry for not replying sooner as I am not getting notification. However, I did manage getting pihole up...
Replies
9
Views
1,767
I'm using adguard/adguardhome and crazymax/unbound. Point Adguard at the unbound box as the upbound server...
Replies
1
Views
2,277
Not sure what's happening but I went drastic. I shut down the PC and did a hard reset of the modem, "enter...
Replies
9
Views
2,002
This indeed is a breaking change. The whole function fix_capabilities() is responsible for the behavior...
Replies
10
Views
2,818
Finally got it dl'd and installed. Had to reconfigure the router.
Replies
4
Views
2,331
I've been running pihole in Docker on my DS920. The only issue I've had is with doing updates. I dl the...
Replies
0
Views
1,790
  • Question
Pihole UI will not work on 80, as 80 is in use by Synology's nginx (as it is 443), just bind it to some...
Replies
8
Views
10,697

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Back
Top