title: Dockerfile for sbt ( scala )
body: <p>in scala app, Im using Dockerfile ( I need Dockerfile instead of native packager to automated builds in hub docker ).</p>
  
  <pre><code>FROM openjdk:8-jre-alpine
  
  ENV SBT_VERSION 0.13.15
  
  RUN apk add --no-cache bash curl openrc git &amp;&amp; \
      curl -sL "http://dl.bintray.com/sbt/native-packages/sbt/$SBT_VERSION/sbt-$SBT_VERSION.tgz" | gunzip | tar -x -C /usr/local &amp;&amp; \
      ln -s /usr/local/sbt/bin/sbt /usr/local/bin/sbt &amp;&amp; \
      chmod 0755 /usr/local/bin/sbt &amp;&amp; \
      apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main --repository  http://dl-cdn.alpinelinux.org/alpine/edge/community docker
  
  RUN rc-update add docker
  
  RUN sbt sbtVersion
  
  COPY . /tmp
  WORKDIR /tmp
  
  RUN sbt stage
  RUN chmod +x runAfterTime.sh
  ENTRYPOINT [ "./runAfterTime.sh" ]
  </code></pre>
  
  <p>but it takes so much time.. downloading half of internet on each change.
  Can this be easily speed up ?</p>
  
  <p>EDIT:
  Im using also "hackaround" , dockerfile:</p>
  
  <pre><code>FROM openjdk:8-jre-alpine
  
  ENV SBT_VERSION 0.13.15
  
  RUN apk add --no-cache bash curl openrc git &amp;&amp; \
      apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main --repository  http://dl-cdn.alpinelinux.org/alpine/edge/community docker
  
  RUN rc-update add docker
  
  COPY target /tmp/target
  
  COPY runAfterTime.sh /tmp
  
  WORKDIR /tmp
  
  RUN chmod +x runAfterTime.sh
  ENTRYPOINT [ "./runAfterTime.sh" ]
  </code></pre>
  
  <p>So build is done from machine, using sbt cache, this way I can build image faster and push to docker hub, but would be nice to speed it up somehow, use sbt cache..</p>