Docker get the container get time error problem resolution:
When using Docker to deploy the site, accidentally found in the container inside time unexpectedly is the United States time, was thunder to, but the solution is also very simple, there are two ways
1, restart a container, plus the following parameters, you can use the host time
$-v/etc/localtime:/etc/localtime:ro # docker run-d-v/etc/localtime:/etc/localtime:ro [Image]
2, if you do not want to reboot, or can not reboot, it does not matter, you can directly copy the file into the container, as follows
$ Docker Cp/etc/localtime [containerid]:/etc/localtime
3, and then through the Date command to view the system time
View this computer's
$ date
View the container's
$ docker exec [Containerid] Date
Have you changed it?
Thank you for reading, I hope to help you, thank you for your support for this site!