Hello all,
My system is Win10 pro, running Docker Desktop (using Linux containers and not Windows containers). My question is on the clock.
When containers are spin up, they acquire current time info from the host (aka Windows) OS. After the containers are running, these containers never check the current time with the Windows host (aka running containers do not sync with the host OS, if the host is Windows). Is this true?
Will this contribute to time drifting (aka time out of syn between the containers and the host OS) after the containers are running a while – since containers only acquire time info from host once at the spin-up of the containers?
Time zone of containers by default is UTC. I can always change the time zone of the containers in the docker compose file using the TZ flag in the environment segment. Am I correct?
Docker Desktop always runs the Docker Engine in a VM, regardless of the host os.
So the relevant date time is the one from the vm that runs the Docker Engine.
If you google for WSL2 clock out of sync, you will find length discussions about it, like this one: WSL2 Clock is out of sync with Windows - Stack Overflow.
If image maintainers change the timezone settings for their images, then it is what they choose instead of UTC. Afaik, setting TZ as environment is worth nothing, if the image maintainers don’t implement something in their entry point scripts that actually makes use of it. Just because many image maintainers decide to add this functionality to their images, doesn’t mean it’s a default behavior for all images - it realy is not.