install tzdata in noninteractive mode#34
Conversation
|
@mikaelarguedas Sorry I was referring to using Here's an example of how to pass firefox a setting: https://unix.stackexchange.com/posts/245783/revisions I think if we did something like echo this sort of data and pipe it to |
|
oh I see. |
|
If that's not installed by default, yes it won't simplify for this cycle, but it will make any other potential customizations easier. And it would also let us set the time zone as we want, instead of requiring us to use the non-interactive fallback. I'm not too strongly tied either way. I think the debconf approach is the "cleaner" approach, but it is slightly more complicated at the moment. |
I don't think tzdata has been in ubuntu docker images before some time, previously however it just so happened to never ask before using UTC as the default:
@tfoote and @BillWSY, I just tried: And it still prompts me to select the geographic area. Funny enugh, if I install tzdata, select the prompts to Etc/UTC, then uninstall tzdata and re-install it, it doesn't prompt me the second time. So there must be something else it configures that was missing the first round. See docker diff here of the container I used.
I got the same issues when following this as well: https://www.dawnbringer.net/blog/600/Docker:%20tzdata cc @tianon or @yosifkit , should we just set Related
|
|
I just looked into the debian install process for the new tzdata package, and its just checking one file and one link, so this works as well: |
Thanks @ruffsl for looking into this, I was missing the symlink. I added a snippet to conditionally add the timezone configuration to the dockerfiles. This should allow to not modify any existing dockerfile. I made it a blacklist, so if cosmic or other future ubuntu distros have the same behavior as bionic it should work without needing us to change anything. |
tfoote
left a comment
There was a problem hiding this comment.
One question about debian support and I'd suggest we collapse this into one RUN layer as an optimization.
| }@ | ||
| @[if os_name == 'ubuntu' and os_code_name not in releases_with_configured_tzdata]@ | ||
|
|
||
| RUN echo 'Etc/UTC' > /etc/timezone |
There was a problem hiding this comment.
We might as well collapse this into one layer. There's no need for the intermediates.
| @@ -0,0 +1,27 @@ | |||
| @{ | |||
| releases_with_configured_tzdata = [ | |||
There was a problem hiding this comment.
Should we exclude this from debian targets like jessie and stretch? They haven't been a problem so could also likely be skipped.
There was a problem hiding this comment.
As this issue doesnt seem to be present in buster or sid (or any already released distro) I decided not to add debian rules for now. We can extend the condition to cover debian platforms when/if we find a debian platform where tzdata starts requiring user input
There was a problem hiding this comment.
Sounds good. lets leave it off for now.
|
Seems reasonable to me. |
|
thanks @tianon for having a look 👍 |
Currently tzdata does not install headless and so the docker build hangs # copied from osrf/docker_templates#34
ubuntu:bionic docker image doesnt ship tzdata anymore, and it prompts the user to specify a timezone at installation time.
This PR installs tzdata in non interactive mode before any other dependency.
Based on @tfoote suggestion, I tried creating
/etc/timezonebefore installing but this still requires dpkg to be run in noninteractive mode so I went back to installing the package independently.The current patch doesnt segregate on os and always performs the install (regardless of the platform). I can modify it to do it only on bionic for now.
Feedback welcome.