[Series] docker docker print server logs and time inconsistency

docker print out the log inconsistent with server time

image.png

docker time is consistent with the host

image.png

Solution

After entering the dokcer, perform the following operations:

ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo "Asia/Shanghai" > /etc/timezone

View Log on to the time the host of the

image.png

Published 111 original articles · won praise 28 · views 40000 +

Guess you like

Origin blog.csdn.net/weixin_42697074/article/details/103956176