Syncing the host machine time into container

14 views
Skip to first unread message

Raghu M N

unread,
Nov 29, 2022, 1:51:06 PM11/29/22
to docker-dev
I need to setup the time inside the container same as host machine time? need any suggestion

Sebastiaan van Stijn

unread,
Nov 30, 2022, 9:13:53 AM11/30/22
to Raghu M N, docker-dev
For production scenarios, it's generally recommended to use the default (UTC) timezone
in containers (and hosts). Doing so makes all containers use the same timezone,
regardless of where they're running. This makes it easier to compare events in a
distributed system (where containers may be running in different areas).

That said, there's a proposal to make reading logs for those containers easier
(allowing users to convert the UTC timezone used in the logs to their local
machine's timezone when viewing them); see https://github.com/moby/moby/issues/33778

For other scenarios (local development), you can find some examples to set the
container's timezone in this ticket: https://github.com/moby/moby/issues/12084

Hope this helps!

- Sebastiaan


On 29 Nov 2022, at 19:51, Raghu M N <raghu...@gmail.com> wrote:

I need to setup the time inside the container same as host machine time? need any suggestion

--
You received this message because you are subscribed to the Google Groups "docker-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to docker-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/docker-dev/5829e502-04e3-48c0-843a-1ee97b1c7327n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages