Docker Community Forums

Share and learn in the Docker community.

Cant change timezone in alpine


(Icyleaf) #1

I did step by step with offical The tutorial here:

macOS date:
2016-9-14 Wednesday 17:21:31 CST

alpine date by default(docker run --rm alpine date):
Tue Sep 13 04:02:31 UTC 2016

change timezone:

apk add tzdata
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

Tue Sep 13 04:05:10 GMT 2016

It’s ok in *unix host system. only happen in macOS with docker for mac.

(JꙨ dцӍoηҬ) #2

usually we just link etc/local time

something like : -v /etc/localtime:/etc/localtime:ro

don’t forget to :ro