-
-
Notifications
You must be signed in to change notification settings - Fork 134
add tzdata package #748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
add tzdata package #748
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3f472c0
add tzdata package
mmichalak-swe 398395c
Merge remote-tracking branch 'upstream/main' into Add-package-tzdata
mmichalak-swe b23d9f3
updated timezone documentation
mmichalak-swe adecb4a
add missing bind-mount from updated docs
mmichalak-swe 21b748e
Add timezone deprecation warnings and related logging to backup commands
mmichalak-swe afee1b7
fix lint CI job error
mmichalak-swe 78f5760
Address PR comments: refactor timezone deprecation warning handling, …
mmichalak-swe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,55 @@ | ||
| --- | ||
| title: Set the timezone the container runs in | ||
| title: Setting the Time Zone | ||
| layout: default | ||
| parent: How Tos | ||
| nav_order: 8 | ||
| --- | ||
|
|
||
| # Set the timezone the container runs in | ||
| # Setting the Time Zone | ||
|
|
||
| By default a container based on this image will run in the UTC timezone. | ||
| As the image is designed to be as small as possible, additional timezone data is not included. | ||
| In case you want to run your cron rules in your local timezone (respecting DST and similar), you can mount your Docker host's `/etc/timezone`, `/etc/localtime`, and `/usr/share/zoneinfo` in read-only mode: | ||
| ## 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](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones): | ||
|
|
||
| ```yml | ||
| services: | ||
| backup: | ||
| image: offen/docker-volume-backup:v2 | ||
| image: offen/docker-volume-backup:latest | ||
| environment: | ||
| - TZ=Europe/Berlin | ||
| 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: | ||
| ``` | ||
|
|
||
| ## 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 `TZ` is not set. | ||
| - If `TZ` is set, it takes precedence over any bind-mounted timezone configuration. | ||
| - An invalid `TZ` value will cause the container to default to UTC. | ||
|
|
||
| :warning: **Deprecation Warning** | ||
| The method described below (bind-mounting files from the host) is **deprecated**. Please use the new method described above (`TZ`) | ||
|
|
||
| > ```yml | ||
| > 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: | ||
| > ``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@m90 let me know your thoughts on the new structure of this file. I also propose that we change the tag from
v2tolatestas a placeholder for the docker-compose file code snippets.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs are great now, thank you.
I would like to stick to using
v2though as it's basically "latest" plus it gives you the guarantee that snippets flying around the internet keep working in case a v3 is ever released: If someone (or a LLM) copies portions of the current documentation, keeps them elsewhere, and then starts using them at a point whenlatesthas moved on to somethingv3, things might break.I.e.
v2should give us the benefits oflatest(not having to update docs over and over again, some sort of autoupdate) without the downsides.