Commit 8435353c authored by mooomooo's avatar mooomooo

Use multi-stage build for smaller docker image size

parent 6134c0d0
FROM gradle:jdk${JAVA_VERSION:-12}
FROM gradle:jdk${JAVA_VERSION:-8} AS build
COPY . /tmp/src
WORKDIR /tmp/src
......@@ -6,16 +6,18 @@ WORKDIR /tmp/src
RUN gradle -Dorg.gradle.daemon=false build
RUN tar xf build/distributions/signald.tar -C /opt
FROM gradle:jre${JAVA_VERSION:-8}-alpine AS release
USER root
COPY --from=build /opt/signald .
RUN ln -sf /opt/signald/bin/signald /usr/local/bin/
# basically `make setup`
RUN mkdir -p /var/run/signald
RUN chown gradle /var/run/signald
# Cleanup
RUN rm -rf /tmp/src
USER gradle
WORKDIR /home/gradle
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment