-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
21 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 |
---|---|---|
@@ -1,35 +1,37 @@ | ||
FROM maven:3-jdk-11 as build | ||
# IMPORTANT: This dockerfile is merely a fallback! | ||
# The recommended way to build a docker image from this java project is using the jib maven plugin | ||
# on the module lsq-pkg-docker-cli: | ||
# mvn clean install | ||
# mvn -pl :lsq-pkg-docker-cli jib:dockerBuild | ||
|
||
# Building this Dockerfile requires buildkit: | ||
# Ensure { "features": { "buildkit": true } } exists in /etc/docker/daemon.json | ||
# (or wherever your deamon.json resides) | ||
|
||
COPY . . | ||
RUN mvn -Pdist,standalone clean install | ||
ARG home="/lsq" | ||
|
||
FROM maven:3-jdk-11 as build | ||
ARG home | ||
ENV HOME "$home" | ||
RUN mkdir -p "$HOME" | ||
WORKDIR "$HOME" | ||
ADD . "$HOME" | ||
RUN --mount=type=cache,target=/root/.m2 mvn -Pdist,standalone clean install | ||
|
||
# Final running image | ||
FROM openjdk:11-jre-slim | ||
|
||
ARG home | ||
ENV HOME "$home" | ||
# Import the lsq-cli jar from the build step | ||
COPY --from=build lsq-cli/target/lsq-cli-*-jar-with-dependencies.jar /app/lsq-cli.jar | ||
|
||
#RUN apt-get update && \ | ||
# apt-get install -y wget | ||
|
||
# # Install Spark for standalone context in /opt | ||
# ENV APACHE_SPARK_VERSION=3.2.0 | ||
# ENV HADOOP_VERSION=3.2 | ||
# ENV SPARK_HOME=/opt/spark | ||
# ENV SPARK_OPTS="--driver-java-options=-Xms1024M --driver-java-options=-Xmx2048M --driver-java-options=-Dlog4j.logLevel=info" | ||
# RUN wget -q -O spark.tgz https://archive.apache.org/dist/spark/spark-${APACHE_SPARK_VERSION}/spark-${APACHE_SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz && \ | ||
# tar xzf spark.tgz -C /opt && \ | ||
# rm "spark.tgz" && \ | ||
# ln -s "/opt/spark-${APACHE_SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}" $SPARK_HOME | ||
|
||
COPY --from=build "$HOME/lsq-pkg-parent/lsq-pkg-uberjar-cli/target/"lsq-pkg-uberjar-cli-*-jar-with-dependencies.jar "$HOME/lsq-cli.jar" | ||
|
||
# Using /data as working directory that will be shared with host for input/output files | ||
WORKDIR /data | ||
VOLUME [ "/data" ] | ||
|
||
ENTRYPOINT ["java","-jar","/app/lsq-cli.jar"] | ||
ENTRYPOINT ["java","-jar","$HOME/lsq-cli.jar"] | ||
CMD ["-h"] | ||
|
||
# Usage: | ||
# docker run -it -v $(pwd):/data ghcr.io/aksw/lsq rx rdfize --endpoint=http://dbpedia.org/sparql virtuoso.dbpedia.log | ||
# docker run -it -v $(pwd):/data ghcr.io/aksw/lsq rx rdfize --endpoint=http://dbpedia.org/sparql virtuoso.dbpedia.log | ||
|