docker/docker — pull request #9112 by crosbymichael (2014-11-12 05:27:54+00:00)
Title: Mount /etc/localtime by default in containers

Right now docker does not handle anything around timezones for
containers. There are a few ways to set the timezone in your container.
You can either use the env var `TZ` or use /etc/localtime. By not
setting one or another then you can have a mismatch between either the
container and the host system or between two containers.

```bash
# before change
root@development:~# date
Tue Nov 11 20:39:01 PST 2014
root@development:~# docker run --rm busybox date
Wed Nov 12 04:39:05 UTC 2014
```

This can cause issues for applications that deal with dates and times.
By mounting /etc/localtime in the container this ensures that the
container's timezones are consistent with the host machine and one
another. The container still has the option to set the `TZ` env var to
override the settings within the /etc/localtime file.

```bash
# after change
root@development:~# date
Tue Nov 11 21:26:31 PST 2014
root@development:~# docker run --rm busybox date
Tue Nov 11 21:26:35 PST 2014
```

Signed-off-by: Michael Crosby