docker-一个安装有jdk8的dockerfile

FROM centos:latest
# 添加jdk压缩包至 /usr/local 目录,压缩包会自动解压,解压后目录名称为jdk1.8.0_181,这个jdk需要下载到本地
ADD jdk-8u181-linux-x64.tar.gz /usr/local/env/jdk/
# 配置JAVA_HOME环境变量
ENV JAVA_HOME /usr/local/env/jdk/jdk1.8.0_181/
# 将JAVA_HOME/bin 添加至PATH环境变量
ENV PATH $JAVA_HOME/bin:$PATH


ADD my-jll-example-netty-springboot-tcp-up.jar /opt/my-jll-example-netty-springboot-tcp-up.jar

RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
EXPOSE 80
ENTRYPOINT java -jar -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap /opt/my-jll-example-netty-s
pringboot-tcp-up.jar && /bin/bash && tail -f /dev/null

你可能感兴趣的:(docker,docker)