mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-12-09 09:13:02 +03:00
Alpine image does not respect TZ environment variable #1575
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @snevas on GitHub.
Alpine image does not respect TZ environment variable
When starting the latest alpine image, UTC time is used. This breaks fail2ban
Your environment
Steps to reproduce
Only changed image: 'bitwardenrs/server' to image: 'bitwardenrs/server:alpine'
Expected behaviour
Would respect TZ-variable
Actual behaviour
Was UTC time (-2 hours)
Relevant logs
'bitwardenrs/server':
'bitwardenrs/server:alpine':
@snevas commented on GitHub:
I think the 3.5MB would justify timezone support. But that's up to @dani-garcia .
Adding the package manually would break my auto-updating and I won't use this image without timezone support because it breaks fail2ban.
@briffle commented on GitHub:
By default, alpine does not include the tzdata package. ( https://gitlab.alpinelinux.org/alpine/aports/-/issues/5543 ) It adds 3.5MB of space to the image, which is rather significant compared to the bare alpine image
To use the timezones, you would need to use apk to install tzdata.
@snevas commented on GitHub:
@davidkna still does not work. The alpine dockerfile is missing the tz package and hard sets UTC. See: https://quaded.com/docker-apline-configure-timezone/
and
https://github.com/dani-garcia/bitwarden_rs/blob/master/docker/amd64/Dockerfile.alpine
@snevas commented on GitHub:
Also adding the following volume did not work:
@davidkna commented on GitHub:
/etc/localtimemight be a symlink. You could try/usr/share/zoneinfo/Europe/Amsterdam:/etc/localtime:roinstead. With podman you could also use either--tz=localor--tz=Europe/Amsterdam.@snevas commented on GitHub:
Retested and confirmed working! No need to add anything to the alpine image 👍
@polyzen commented on GitHub:
Making a read-only bind mount to the host's
/etc/localtimeseems to have worked for me.-v /etc/localtime:/etc/localtime:roshould be the option -- I had manually edited my container'sconfig.v2.jsonto add the mount.@polyzen commented on GitHub:
Seems like using the
logtimezone = UTCoption for your jail might be cleaner.