
0

Docker 时间设置
source link: https://linuxsuren.github.io/blog/devops/docker/docker-time/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Docker 时间设置
Docker 时间设置
通过如下配置,就可以实现对容器内的时区设置:
ENV TZ=Hongkong
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
如何运行的是 Java 程序的话,还可以通过命令行参数在运行时指定:
docker run -p 8888:8080 -e JAVA_OPTS="-Duser.timezone=HongKong" jenkins/jenkins:lts
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK