设置时区,这样安装依赖时候就不需要选
ENV TZ=Asia/Shanghai RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone
ENV TZ=Asia/Shanghai RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone
查看当前时间及时区状态sudo timedatectl status# 显示当前时区为Asia/Shanghai查看当前系统时间sudo date查看当前系统时间及时区sudo date -R# 显示当前时间及对应时区,时区为“+0800”北京时区修改硬件时间修改日期格式:MM月/DD日/YYYY年sudo date -s MM/DD/YYYY修改时间:hh时:mm分:ss秒 sudo date
我们打包镜像时使用的基础镜像基本上都是采用UTC(格林时间),与我们常用的北京(上海)时间(CST)相差8个小时。我们可以在创建一个容器的时候,将宿主机时区相关的目录文件挂在到容器上: ...
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtimeRUN echo 'Asia/Shanghai' >/etc/timezoneEG、FROM fiadliel/java8-jreVOLUME /tmpADD api_h5-0.1.jar app.jarRUN ln -sf /usr/share/zone
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M