projectatomic / container-best-practices

Container Best Practices
Other
166 stars 70 forks source link

Is mounting /etc/localtime to a container OK without also mounting /etc/timezone? #110

Open sprior opened 7 years ago

sprior commented 7 years ago

I found your tip of mounting the hosts /etc/localtime to the container, but it looks like Debian distros don't depend on /etc/localtime being a symlink to the tzdata file, they use the /etc/timezone file to identify the timezone. So is it OK to mount /etc/localtime from the host to container without also mounting /etc/timezone? Even if the OS did still depend on /etc/localtime being a symlink, it doesn't seem that this symlink association would be visible to the container.

dav1x commented 7 years ago

@sprior I think this would be distro specific. The symlink would be flattened out and would be a reference point but wouldn't be honored for changes. I would do as you said and simply bind mount /etc/timezone for debian based distros.