Back to home page

OSCL-LXR

 
 

    


0001 #
0002 # Licensed to the Apache Software Foundation (ASF) under one or more
0003 # contributor license agreements.  See the NOTICE file distributed with
0004 # this work for additional information regarding copyright ownership.
0005 # The ASF licenses this file to You under the Apache License, Version 2.0
0006 # (the "License"); you may not use this file except in compliance with
0007 # the License.  You may obtain a copy of the License at
0008 #
0009 #    http://www.apache.org/licenses/LICENSE-2.0
0010 #
0011 # Unless required by applicable law or agreed to in writing, software
0012 # distributed under the License is distributed on an "AS IS" BASIS,
0013 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0014 # See the License for the specific language governing permissions and
0015 # limitations under the License.
0016 #
0017 ARG java_image_tag=8-jre-slim
0018 
0019 FROM openjdk:${java_image_tag}
0020 
0021 ARG spark_uid=185
0022 
0023 # Before building the docker image, first build and make a Spark distribution following
0024 # the instructions in http://spark.apache.org/docs/latest/building-spark.html.
0025 # If this docker file is being used in the context of building your images from a Spark
0026 # distribution, the docker build command should be invoked from the top level directory
0027 # of the Spark distribution. E.g.:
0028 # docker build -t spark:latest -f kubernetes/dockerfiles/spark/Dockerfile .
0029 
0030 RUN set -ex && \
0031     sed -i 's/http:/https:/g' /etc/apt/sources.list && \
0032     apt-get update && \
0033     ln -s /lib /lib64 && \
0034     apt install -y bash tini libc6 libpam-modules krb5-user libnss3 && \
0035     mkdir -p /opt/spark && \
0036     mkdir -p /opt/spark/examples && \
0037     mkdir -p /opt/spark/work-dir && \
0038     touch /opt/spark/RELEASE && \
0039     rm /bin/sh && \
0040     ln -sv /bin/bash /bin/sh && \
0041     echo "auth required pam_wheel.so use_uid" >> /etc/pam.d/su && \
0042     chgrp root /etc/passwd && chmod ug+rw /etc/passwd && \
0043     rm -rf /var/cache/apt/*
0044 
0045 COPY jars /opt/spark/jars
0046 COPY bin /opt/spark/bin
0047 COPY sbin /opt/spark/sbin
0048 COPY kubernetes/dockerfiles/spark/entrypoint.sh /opt/
0049 COPY examples /opt/spark/examples
0050 COPY kubernetes/tests /opt/spark/tests
0051 COPY data /opt/spark/data
0052 
0053 ENV SPARK_HOME /opt/spark
0054 
0055 WORKDIR /opt/spark/work-dir
0056 RUN chmod g+w /opt/spark/work-dir
0057 
0058 ENTRYPOINT [ "/opt/entrypoint.sh" ]
0059 
0060 # Specify the User that the actual main process will run as
0061 USER ${spark_uid}