Kardbord / Kard-bot

A Discord bot destined for greatness
GNU Affero General Public License v3.0
1 stars 0 forks source link

Docker container timezone is not synced with host #24

Closed Kardbord closed 2 years ago

Kardbord commented 2 years ago

Containers running the image provided with Kard-bot releases up to at least v1.4.0-beta will not be synchronized to the host's timezone. This is particularly annoying for cron-like functionality such as daily compliments and Wednesday posting.

Kardbord commented 2 years ago

Ideally I would like to set the timezone to match the host in docker-compose rather than bake it into the docker image. It might be possible by creating read-only volume mounts for /etc/timezone, /etc/localtime, and /usr/share/zoneinfo. Sounds like there may be some "gotchas" to watch out for due to symlinks. See https://serverfault.com/questions/683605/.

Kardbord commented 2 years ago

Since the release images are based on alpine, I may need to install the tzdata package in order to get the timezone to take. See https://github.com/gliderlabs/docker-alpine/issues/136.

Kardbord commented 2 years ago

As fixed as it's going to get for now in v1.4.1-beta. It's a considerably bigger hassle than I would have thought to automatically set the time zone to match the host machine. For now anyone hosting the bot (which will probably just be me) will just have to set the time zone manually.