ãªãããã
dockerã§è¯ã使ããã軽éã¤ã¡ã¼ã¸alpineã¯ãããã©ã«ãtimezoneãUTCã«ãªã£ã¦ãããAsia/Tokyo (JST) ã«è¨å®ããªãã¨æ¥æ¬æéãã9æéããã¦ãã¾ãã
ã©ãããã
Dockerfileã«ä¸è¨ã®ããã«è¨ãã°OK
FROM alpine:latest RUN apk --no-cache add tzdata && \ cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime && \ apk del tzdata
ããã¨ã»ãããã®éã
$ docker build . -t alpine-jst Sending build context to Docker daemon 2.048kB Step 1/2 : FROM alpine:latest ... Successfully tagged alpine-jst:latest $ docker run --rm alpine-jst date Fri Jul 12 07:52:07 JST 2019
è£è¶³: ãªã && ã§ã¤ãªããããtzdataãåé¤ããã®ã
Dockerfileã®ãã¹ããã©ã¯ãã£ã¹ã«å¾ãã¨å¿ ç¶çã«ãããªãã
cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
ã®ãããå¿ è¦ãªãã®ã¯æ¢ã«ã³ãã¼æ¸ã¿ãªã®ã§ããããã±ã¼ã¸ã¨ãã¦tzdataãã¤ã³ã¹ãã¼ã«ãã¦ããçç±ããªã- alpine使ãããããªã®ã§å°ãã§ãã¤ã¡ã¼ã¸ãµã¤ãºå°ããããããã«ä½è¨ãªãã®ã¯ç©æ¥µçã«åé¤ãã
éçºç¨ã ã¨ãã試ãç®çããããªãããã¾ã§ãããªãã¦ãè¯ãã¨æãã