blob: e42c7f1420ef586c067f4869dce9f2414c995750 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
FROM openjdk:14-slim AS staging
MAINTAINER OpenDC Maintainers <opendc@atlarge-research.com>
# Build staging artifacts for dependency caching
COPY ./ /app
WORKDIR /app
RUN mkdir /staging \
&& cp -r buildSrc/ /staging \
&& cp gradle.properties /staging 2>/dev/null | true \
&& find -name "*.gradle.kts" | xargs cp --parents -t /staging
FROM openjdk:14-slim AS builder
# Obtain (cache) Gradle wrapper
COPY gradlew /app/
COPY gradle /app/gradle
WORKDIR /app
RUN ./gradlew --version
# Install (cache) project dependencies only
COPY --from=staging /staging/ /app/
RUN ./gradlew clean build --no-daemon > /dev/null 2>&1 || true
# Build project
COPY ./ /app/
RUN ./gradlew --no-daemon :opendc:opendc-runner-web:installDist
FROM openjdk:14-slim
COPY --from=builder /app/opendc/opendc-runner-web/build/install /app
WORKDIR /app
CMD opendc-runner-web/bin/opendc-runner-web
|