scripts: added TZ environment variable to set timezone#2530
scripts: added TZ environment variable to set timezone#2530georglauterbach merged 9 commits intomasterfrom
TZ environment variable to set timezone#2530Conversation
Co-authored-by: Frederic Werner <[email protected]>
wernerfred
left a comment
There was a problem hiding this comment.
Not familiar with debconf tzdata command but the rest seems logical to me 👍🏻
Trust me, I played around with this with the help of |
Did you try something simple like this? function _setup_timezone
{
_log 'info' "Setting timezone to '${TZ}'"
ln -fs "/usr/share/zoneinfo/${TZ}" /etc/localtime &&
dpkg-reconfigure -f noninteractive tzdata &>/dev/null
}If so, what problems did you encounter? That's similar to what I use and never had problems with. PS: Your test ran successful with this one too. |
Co-authored-by: Casper <[email protected]>
Does something speaks against this implementation? Easier to follow along for me (who doesnt have a clue about tzdata). Just curious. |
It's been a long time, but I think I tried a few ways.
I have to admit, I do not remember (if there even were any).
Nothing, really. I got to be honest though, I'm not sure about this because I vividly remember that some setups caused issues. BUT since tests seem to pass though as @casperklein reported, I will change it because it indeed looks easier :D |
I adjusted the Dockerfile here, and set `DEBIAN_FRONTEND` and `DEBCONF_NONINTERACTIVE_SEEN` as ENV to have it available in the container as well. This was done because 1. this is "a" proper way of disabling interactive deb-conf 2. especially this solution allows for non-interactive deb-conf everywhere without always specifying the variables / CLI options as well
I adjusted the Dockerfile here, and set `DEBIAN_FRONTEND` and `DEBCONF_NONINTERACTIVE_SEEN` as ENV to have it available in the container as well. This was done because 1. this is "a" proper way of disabling interactive deb-conf 2. especially this solution allows for non-interactive deb-conf everywhere without always specifying the variables / CLI options as well
|
Not sure what happened there with 88a1d5b, but this is probably on me because I tried to push before I pulled (again...). Changes seems okay though, all is well. |
4d261e2
|
Documentation preview for this PR is ready! 🎉 Built with commit: 4d261e2 |
Description
We currently set the time zone by mounting
/etc/localtime. This is fine for Docker, and users will still be able to set their time like that. This PR introduces a new way of setting date and time, that one users can use alternatively. This is especially nice when mounting from the host is difficult. Moreover, I think this is nicer, more elegant and cleaner than mounting/etc/localtime. If you prefer mounting/etc/localtimethough, you can still do that.Type of change
Checklist:
docs/)