You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by an...@apache.org on 2019/08/20 13:36:42 UTC
[fineract-cn-identity] branch develop updated: FINCN-170 create
multi-stage Docker build
This is an automated email from the ASF dual-hosted git repository.
angeh pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-identity.git
The following commit(s) were added to refs/heads/develop by this push:
new b433c8e FINCN-170 create multi-stage Docker build
new 7b761e6 Merge pull request #13 from aasaru/multi-stage-docker-build
b433c8e is described below
commit b433c8e58793c985f0ca713b61eff4f3ffe32dab
Author: Juhan Aasaru <Ju...@nortal.com>
AuthorDate: Fri Aug 16 15:05:38 2019 +0300
FINCN-170 create multi-stage Docker build
---
.dockerignore | 10 ----------
Dockerfile | 14 +++++++++++---
2 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/.dockerignore b/.dockerignore
index 8d88495..a3b6dc5 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,17 +1,7 @@
-api/
-component-test/
-gradle/
-gradlew.bat
LICENSE
README.md
-settings.gradle
-build.gradle
docs/
-gradlew
HEADER
NOTICE.txt
-service/
.git/
-.gradle/
.gitignore
-shared.gradle
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index b129d2f..3d4473a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -16,7 +16,14 @@
# specific language governing permissions and limitations
# under the License.
#
-FROM openjdk:8-jdk-alpine
+FROM openjdk:8-jdk-alpine AS builder
+RUN mkdir builddir
+COPY . builddir
+WORKDIR builddir
+RUN ./gradlew publishToMavenLocal
+
+
+FROM openjdk:8-jdk-alpine AS runner
ARG identity_port=2021
@@ -25,6 +32,7 @@ ENV server.max-http-header-size=16384 \
server.port=$identity_port
WORKDIR /tmp
-RUN wget -O identity-service-boot-0.1.0-BUILD-SNAPSHOT.jar https://mifos.jfrog.io/mifos/libs-snapshot/org/apache/fineract/cn/identity/service-boot/0.1.0-BUILD-SNAPSHOT/service-boot-0.1.0-BUILD-SNAPSHOT.jar
-CMD ["java", "-jar", "identity-service-boot-0.1.0-BUILD-SNAPSHOT.jar"]
+COPY --from=builder /builddir/service/build/libs/service-0.1.0-BUILD-SNAPSHOT-boot.jar ./identity-service-boot.jar
+
+CMD ["java", "-jar", "identity-service-boot.jar"]