实际示例:
[root@master01 home-dataline]# ls dataline.jar Dockerfile jdk-8u181-linux-x64.tar.gz
[root@master01 home-dataline]# cat Dockerfile FROM centos MAINTAINER weifeng "weifeng@zh******.cn" ENV LANG en_US.UTF-8 RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone WORKDIR /home RUN mkdir JDK COPY jdk-8u181-linux-x64.tar.gz /home/ COPY d*****ne.jar /home/ RUN tar zxf /home/jdk-8u181-linux-x64.tar.gz -C /home/JDK ENV JAVA_HOME /home/JDK/jdk1.8.0_181 ENV PATH $PATH:$JAVA_HOME/bin EXPOSE 8080 ENTRYPOINT ["java","-jar","da****ne.jar"," -Xms512m","-Xmx2048m","--spring.profiles.active=dev","--server.port=8080"]
docker build -t dat****e-jar02 /home-dataline/ docker run -it --name da***e-jar02 -p 8080:8080 da***e-jar02 /bin/bash