Docker alpine 设置东八时区

FROM alpine:3.8

RUN echo 'http://mirrors.ustc.edu.cn/alpine/v3.5/main' > /etc/apk/repositories
&& echo 'http://mirrors.ustc.edu.cn/alpine/v3.5/community' >>/etc/apk/repositories
&& apk update && apk add tzdata
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
&& echo "Asia/Shanghai" > /etc/timezone


build

docker build --rm --no-cache -t chengloong/demo .


run

docker run -it chengloong/demo date


output

Thu Dec 20 20:16:40 CST 2018


本文由个人 hexo 博客 [co2fe.com](http://www.co2fe.com) 迁移
date: 2018-12-20 20:14:27
posted @ 2018-12-28 15:56  LiuChengloong  阅读(1051)  评论(0编辑  收藏  举报