Skip to content

Commit

Permalink
Use symbolic link for jar
Browse files Browse the repository at this point in the history
  • Loading branch information
mgdigital committed May 11, 2019
1 parent 98fb359 commit 75b9986
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ FROM ubuntu:18.04 as base

ENV SBT_VERSION 1.2.8
ENV SCALA_VERSION 2.12
ENV CHROMAPRINT_VERSION 0.1.0-SNAPSHOT

RUN \
sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list \
RUN sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list \
&& apt-get update \
&& apt-get -y upgrade \
&& apt-get install -y \
Expand All @@ -17,23 +15,27 @@ RUN \
libavcodec-extra \
&& apt-get clean

RUN \
curl -L -o /tmp/sbt-$SBT_VERSION.deb https://dl.bintray.com/sbt/debian/sbt-$SBT_VERSION.deb \
RUN curl -L -o /tmp/sbt-$SBT_VERSION.deb https://dl.bintray.com/sbt/debian/sbt-$SBT_VERSION.deb \
&& dpkg -i /tmp/sbt-$SBT_VERSION.deb \
&& rm /tmp/sbt-$SBT_VERSION.deb

ADD . /chromaprint
WORKDIR /chromaprint

RUN sbt reload

ENTRYPOINT ["/bin/bash"]

FROM base as packaged

RUN sbt "; test; package; assembly"

RUN bash -c "source /chromaprint/target/scala-$SCALA_VERSION/classes/version.properties \
&& ln -s /chromaprint/target/scala-$SCALA_VERSION/chromaprint-assembly-\$version.jar /chromaprint-standalone.jar"

RUN echo "#!/bin/sh\n\
set -e\n\
sh -c \"java -jar /chromaprint/target/scala-$SCALA_VERSION/chromaprint-assembly-$CHROMAPRINT_VERSION.jar \$@\"\n\
sh -c \"java -jar /chromaprint-standalone.jar \$@\"\n\
" > /docker-entrypoint.sh \
&& chmod +x /docker-entrypoint.sh

Expand Down

0 comments on commit 75b9986

Please sign in to comment.