dockerfile centos+jdk+时区设置

1、参考博客:https://blog.csdn.net/yjk13703623757/article/details/68944549

2、dockerfile如下

# Base os image
FROM centos:latest
MAINTAINER Joey <445923276@qq.com>
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

#OS
RUN yum install -y wget
RUN yum install -y unzip zip
#install jdk RUN mkdir /var/tmp/jdk RUN wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" -P /var/tmp/jdk http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171-linux-x64.tar.gz RUN tar xzf /var/tmp/jdk/jdk-8u171-linux-x64.tar.gz -C /var/tmp/jdk && rm -rf /var/tmp/jdk/jdk-8u171-linux-x64.tar.gz #env ENV JAVA_HOME /var/tmp/jdk/jdk1.8.0_171 ENV PATH $PATH:$JAVA_HOME/bin

3、docker build -t centos:jdk8 .

4、上方空白小红点千万不要忘记

posted @ 2018-06-12 15:27  一问三不知。  阅读(1744)  评论(0编辑  收藏  举报