On 12/08/2016 11:04 AM, Frantisek Kluknavsky wrote: > On 07/12/16 22:14, Daniel J Walsh wrote: >> The following bugzilla shows a problem with containers. >> >> https://bugzilla.redhat.com/show_bug.cgi?id=1399749\\ >> >> People want to be able to volume mount in /etc/localtime into a >> container to change its TimeZone. The problem is the way the kernel >> handles bind mounting symbolic links >> >> On my host I have >> >> ls -l /etc/localtime >> >> lrwxrwxrwx. 1 root root 38 Dec 7 16:09 /etc/localtime -> >> ../usr/share/zoneinfo/America/New_York >> >> In a Fedora container I have >> >> ls -l /etc/localtime >> lrwxrwxrwx. 1 root root 25 Dec 7 21:08 /etc/localtime -> >> ../usr/share/zoneinfo/UTC >> >> If you run a docker container like >> >> >> docker run -ti -v /etc/localtime:/etc/localtime:ro fedora bash >> >> >> You do not end up with /etc/localtime as a link pointing to New York, >> You end up with the >> >> /usr/share/zoneinfo/New_York file mounted over the >> /usr/share/zoneinfo/UTC file. >> >> IE the mount -o bind command follows both symbolic links. >> >> This is causing issues with the java program inside the bugzilla. >> >> The proposed fix is to change container images to >> >> rm -f /etc/localtime >> >> cp /usr/share/zoneinfo/UTC /etc/localtime >> >> >> Then if I do the command above >> >> docker run -ti -v /etc/localtime:/etc/localtime:ro fedora bash >> >> I end up with the /etc/localtime file inside of the container containing >> the content of the New_York file. >> >> Does anyone object to this idea? >> > Hi, > > a related question: Once you bind-mount /etc/localtime as a normal file > (not symlink) from the host, do you still need full /usr/share/zoneinfo? > The size in uncompressed form is a few megabytes - not completely > negligible. > > Except the obvious inability to change timezones, what else would break? > > Have a nice day, > > Fero > I would be fine with removing them, and requiring them be changed from the host.
But Only use I know of is to change timezone by modifying the link.