Skip to content

Instantly share code, notes, and snippets.

@mvillarrealb
Last active September 23, 2018 17:29
Show Gist options
  • Save mvillarrealb/03832b4a669acd27853d86db0ba14559 to your computer and use it in GitHub Desktop.
Save mvillarrealb/03832b4a669acd27853d86db0ba14559 to your computer and use it in GitHub Desktop.
A custom docker image based on spark-base:2.3.1 image, used to create a spark-submit containers that runs and die once they delivered the driver program to the cluster
#!/bin/bash
/spark/bin/spark-submit \
--class ${SPARK_APPLICATION_MAIN_CLASS} \
--master ${SPARK_MASTER_URL} \
--deploy-mode cluster \
--total-executor-cores 1 \
${SPARK_SUBMIT_ARGS} \
${SPARK_APPLICATION_JAR_LOCATION} \
${SPARK_APPLICATION_ARGS}
FROM spark-base:2.3.1
COPY spark-submit.sh /
ENV SPARK_MASTER_URL="spark://spark-master:7077"
ENV SPARK_SUBMIT_ARGS=""
ENV SPARK_APPLICATION_ARGS ""
#ENV SPARK_APPLICATION_JAR_LOCATION /opt/spark-apps/myjar.jar
#ENV SPARK_APPLICATION_MAIN_CLASS my.main.Application
CMD ["/bin/bash", "/spark-submit.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment