Skip to content
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

Support for timezones? #28

Closed
larskruckow opened this issue Oct 23, 2021 · 3 comments
Closed

Support for timezones? #28

larskruckow opened this issue Oct 23, 2021 · 3 comments
Labels
documentation Improvements or additions to documentation support Support Requests

Comments

@larskruckow
Copy link

I can see that it runs with default UTC time.
This makes it difficult to time everything to specific local times (especially with daylight saving)
I suggest adding support for setting the timezone it runs under in the environment

@m90
Copy link
Member

m90 commented Oct 23, 2021

In case you are able to set the host system's time (or just want to align the container time and the host time) you can mount /etc/timezone and /etc/localtime (readonly is enough) into the container:

~ docker run --rm -it --entrypoint ash offen/docker-volume-backup:latest 
~ # date
Sat Oct 23 13:29:31 UTC 2021~ docker run --rm -it --entrypoint ash -v /etc/timezone:/etc/timzeone:ro -v /etc/localtime:/etc/localtime:ro offen/docker-volume-backup:latest
~ # date
Sat Oct 23 15:29:31 CEST 2021

Does this solve your usecase?


In case the image should support setting an arbitrary timezone through a TZ environment variable, it would need to install the tzdata package, which weighs in at 3.3MB and would add ~20% on top of the current image size, so I would like to avoid this in case it's possible.

@larskruckow
Copy link
Author

Thanks.
Don't know why I didn't think of that.
I totally see your point with the increased size.
I can confirm that using the host time cron then runs at expected time as is on the host.

@m90 m90 added the support Support Requests label Oct 23, 2021
@m90
Copy link
Member

m90 commented Oct 23, 2021

I added a section on this to the README. Thanks for raising this.

@m90 m90 added the documentation Improvements or additions to documentation label Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation support Support Requests
Projects
None yet
Development

No branches or pull requests

2 participants