mirror of
https://github.com/offen/docker-volume-backup.git
synced 2026-04-27 18:55:36 +02:00
* add tzdata package * updated timezone documentation * add missing bind-mount from updated docs * Add timezone deprecation warnings and related logging to backup commands * fix lint CI job error * Address PR comments: refactor timezone deprecation warning handling, update docs
1.4 KiB
1.4 KiB
title, layout, parent, nav_order
| title | layout | parent | nav_order |
|---|---|---|---|
| Setting the Time Zone | default | How Tos | 8 |
Setting the Time Zone
Use Environment Variable TZ
A container started using this image will default to UTC. To modify the time zone, set the TZ environment variable to a valid tz database time zone:
services:
backup:
image: offen/docker-volume-backup:latest
environment:
- TZ=Europe/Berlin
volumes:
- data:/backup/my-app-backup:ro
volumes:
data:
Notes
This approach is preferred because it:
- avoids dependency on host configuration
- works consistently across environments
Compatibility
- Bind-mounting timezone files will continue to work if
TZis not set. - If
TZis set, it takes precedence over any bind-mounted timezone configuration. - An invalid
TZvalue will cause the container to default to UTC.
⚠️ Deprecation Warning
The method described below (bind-mounting files from the host) is deprecated. Please use the new method described above (TZ)
services: backup: image: offen/docker-volume-backup:latest volumes: - data:/backup/my-app-backup:ro - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro - /usr/share/zoneinfo:/usr/share/zoneinfo:ro volumes: data: