diff --git a/template/java8/Dockerfile b/template/java8/Dockerfile index c994a52a..8f040c62 100644 --- a/template/java8/Dockerfile +++ b/template/java8/Dockerfile @@ -22,6 +22,10 @@ COPY . /home/app/ RUN gradle build +RUN rm /home/app/entrypoint/build/distributions/entrypoint* + +RUN gradle distZip + FROM openjdk:8u121-jdk-alpine as ship RUN apk --no-cache add curl \ && echo "Pulling watchdog binary from Github." \ diff --git a/template/java8/entrypoint/build.gradle b/template/java8/entrypoint/build.gradle index d059c573..e9ec4e84 100644 --- a/template/java8/entrypoint/build.gradle +++ b/template/java8/entrypoint/build.gradle @@ -13,6 +13,9 @@ plugins { // Apply the application plugin to add support for building an application id 'application' + // Apply the distribution plugin to add resources to entrypoint dist + id 'distribution' + } // Define the main class for the application @@ -29,6 +32,14 @@ dependencies { compile project(':function') } +sourceSets { + main { + resources { + srcDirs "src/main/resources" + } + } +} + jar { manifest { attributes 'Implementation-Title': 'OpenFaaS Function',