dockerfile centos镜像 设置时区与宿主机一致

1、用了官网的centos,发现时区与宿主机不一致!我的服务里有用到currenttime,所以在centos镜像的基础上 新制作了镜像

2、dockerfile 如下

# Base os image
FROM centos:latest
MAINTAINER Joey <your email>
LABEL Description="This image is the base os images."  Version="1.0"
# reconfig timezone

ENV  TIME_ZONE Asia/Shanghai
#dockerfile
RUN ln -sf /usr/share/zoneinfo/${TIME_ZONE} /etc/localtime

3、docker build centos:time .

4、注意上面的红色空白小点 非常重要!!

猜你喜欢

转载自www.cnblogs.com/JoeyWong/p/9173205.html