1.编写Dockerfile
FROM centos6.5:v1
LABEL ="578888218@"
#jdk
#增加jdk
ADD jdk-8u171-linux-x64.tar.gz /etc/java/jdk
RUN ln -s /etc/java/jdk/jdk1.8.0_171 /etc/java/jdk/jdk1.8
#安装环境变量
ENV JAVA_HOME /etc/java/jdk/jdk1.8
ENV PATH $JAVA_HOME/bin:$PATH
ADD spark-2.2.2-bin-hadoop2.7.tgz /usr/local
RUN ln -s /usr/local/spark-2.2.2-bin-hadoop2.7 /usr/local/spark
2.验证是否安装成功