JDK

#mybase.my.com/base/jdk:8u333
FROM centos:7.9.2009
MAINTAINER my@email.com
LABEL Description="基于centos:7.9.2009镜像,增加jdk-8u333-linux-x64.tar.gz和环境变量"
WORKDIR ./usr/local
RUN mkdir jdk &&  chmod 777 /usr/local/jdk
# ADD 会解压,COPY不会解压
ADD jdk-8u333-linux-x64.tar.gz /usr/local/jdk
ENV JAVA_HOME /usr/local/jdk/jdk1.8.0_333
ENV CLASSPATH=$JAVA_HOME/bin:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
ENV PATH=.:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
ENV TZ Asia/Shanghai

JRE

#mybase.my.com/base/jre:8u333
FROM centos:7.9.2009
MAINTAINER my@email.com
LABEL Description="基于centos:7.9.2009镜像,增加server-jre-8u333-linux-x64.tar.gz和环境变量"
WORKDIR ./usr/local
RUN mkdir jre &&  chmod 777 /usr/local/jre
# server-jre-8u333-linux-x64.tar.gz解压后的确叫jdk1.8.0_281
# jdk1.8.0_333下也有jre目录,但是比jdk的同目录少许多工具
ADD server-jre-8u333-linux-x64.tar.gz /usr/local/jre
ENV JAVA_HOME /usr/local/jre/jdk1.8.0_333
ENV CLASSPATH=$JAVA_HOME/bin:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
ENV PATH=.:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
ENV TZ Asia/Shanghai

发表回复

您的电子邮箱地址不会被公开。

Captcha Code