Skip to content

Commit

Permalink
Updated docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
Aklakan committed Oct 28, 2023
1 parent 3ad7ac4 commit ed0fce7
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions Dockerfile
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

0 comments on commit ed0fce7

Please sign in to comment.