search

Home  >  Q&A  >  body text

java - Docker容器时间同步问题?

PHPzPHPz2892 days ago366

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-04-18 09:30:59

    The system has been changed to UTC, how to change it to CST?
    Since the /usr/share/zoneinfo/Asia/Shanghai file was modified at the beginning, the file was restored later, and then executed /usr/share/zoneinfo/Asia/Shanghai文件,后面将文件恢复了,然后执行
    cp -af /usr/share/zoneinfo/Asia/Shanghai /etc/localtimecp -af /usr/share/zoneinfo/Asia/Shanghai / etc/localtime will do the trick.

    docker time synchronization:
    can be modified through docker cp /etc/localtime [containerId]:/etc/localtime

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 09:30:59

    I also encountered this situation. I don’t know whether your mysql is installed directly on the system or is a mirror pulled from the official one.
    I changed the time zone directly from the Dockerfile of the official image: link description

    reply
    0
  • Cancelreply