-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I think it makes sense to have the Dockerfile in the repository itself. Resolves #739 Co-authored-by: Anders <[email protected]> Co-authored-by: colin-rogers-dbt <[email protected]>
- Loading branch information
1 parent
01c9fd0
commit efa1b18
Showing
4 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Security | ||
body: Add docker image to the repo | ||
time: 2023-08-17T14:56:26.361208+02:00 | ||
custom: | ||
Author: Fokko | ||
PR: "876" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
ARG OPENJDK_VERSION=8 | ||
FROM eclipse-temurin:${OPENJDK_VERSION}-jre | ||
|
||
ARG BUILD_DATE | ||
ARG SPARK_VERSION=3.3.2 | ||
ARG HADOOP_VERSION=3 | ||
|
||
LABEL org.label-schema.name="Apache Spark ${SPARK_VERSION}" \ | ||
org.label-schema.build-date=$BUILD_DATE \ | ||
org.label-schema.version=$SPARK_VERSION | ||
|
||
ENV SPARK_HOME /usr/spark | ||
ENV PATH="/usr/spark/bin:/usr/spark/sbin:${PATH}" | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y wget netcat procps libpostgresql-jdbc-java && \ | ||
wget -q "http://archive.apache.org/dist/spark/spark-${SPARK_VERSION}/spark-${SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz" && \ | ||
tar xzf "spark-${SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz" && \ | ||
rm "spark-${SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz" && \ | ||
mv "spark-${SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}" /usr/spark && \ | ||
ln -s /usr/share/java/postgresql-jdbc4.jar /usr/spark/jars/postgresql-jdbc4.jar && \ | ||
apt-get remove -y wget && \ | ||
apt-get autoremove -y && \ | ||
apt-get clean | ||
|
||
COPY entrypoint.sh /scripts/ | ||
RUN chmod +x /scripts/entrypoint.sh | ||
|
||
ENTRYPOINT ["/scripts/entrypoint.sh"] | ||
CMD ["--help"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
if [ -n "$WAIT_FOR" ]; then | ||
IFS=';' read -a HOSTPORT_ARRAY <<< "$WAIT_FOR" | ||
for HOSTPORT in "${HOSTPORT_ARRAY[@]}" | ||
do | ||
WAIT_FOR_HOST=${HOSTPORT%:*} | ||
WAIT_FOR_PORT=${HOSTPORT#*:} | ||
|
||
echo Waiting for $WAIT_FOR_HOST to listen on $WAIT_FOR_PORT... | ||
while ! nc -z $WAIT_FOR_HOST $WAIT_FOR_PORT; do echo sleeping; sleep 2; done | ||
done | ||
fi | ||
|
||
exec spark-submit "$@" |