How to make sure docker's time syncs with that of the host?

前端 未结 17 1514
北恋
北恋 2020-12-02 07:10

I have dockers running on Linode servers. At times, I see that the time is not right on the dockers. Currently I have changed the run script in every docker to include the f

17条回答
  •  -上瘾入骨i
    2020-12-02 07:22

    Although this is not a general solution for every host, someone may find it useful. If you know where you are based (UK for me) then look at tianon's answer here.

    FROM alpine:3.6
    RUN apk add --no-cache tzdata
    ENV TZ Europe/London
    

    This is what I added to my Dockerfile ^ and the timezone problem was fixed.

提交回复
热议问题