From 69cd297355e7dfea6e67bd053ec041b2b538857d Mon Sep 17 00:00:00 2001 From: Dert1129 Date: Thu, 6 Oct 2022 12:12:58 -0400 Subject: [PATCH 1/3] implemented docker image push --- Dockerfile | 15 +++++++++++++++ build.gradle | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1465a31 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM alpine + +RUN apk update && \ + apk upgrade +RUN apk add openjdk8 + +VOLUME /tmp +ARG DEPENDENCY=target/dependency + +COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib +COPY ${DEPENDENCY}/META-INF /app/META-INF +COPY ${DEPENDENCY}/BOOT-INF/classes /app +RUN echo '* * * * * java -cp /app:/app/lib/* org.kpmp.FailedPackageChecker' >> /etc/crontabs/root + +CMD crond && java -cp /app:app/lib/* org.kpmp.Application \ No newline at end of file diff --git a/build.gradle b/build.gradle index daf05af..748750e 100644 --- a/build.gradle +++ b/build.gradle @@ -7,11 +7,18 @@ buildscript { } } +plugins { + id 'com.palantir.docker' version '0.22.1' +} + +group = 'kingstonduo' + apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'idea' apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' +apply plugin: 'com.palantir.docker' eclipse { project.natures 'org.eclipse.buildship.core.gradleprojectnature' @@ -48,3 +55,15 @@ dependencies { springBoot { mainClass = "org.kpmp.eridanus.Application" } + +task unpack(type: Copy) { + dependsOn bootJar + from(zipTree(tasks.bootJar.outputs.files.singleFile)) + into("build/dependency") +} + +docker { + name "${project.group}/${jar.baseName}:${project.version}" + copySpec.from(tasks.unpack.outputs).into("dependency") + buildArgs(['DEPENDENCY': "dependency"]) +} \ No newline at end of file From 43722959ddd5bcf5c1dca85465cc852ece688169 Mon Sep 17 00:00:00 2001 From: Dert1129 Date: Thu, 6 Oct 2022 13:48:42 -0400 Subject: [PATCH 2/3] updated version --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index 748750e..11a442a 100644 --- a/build.gradle +++ b/build.gradle @@ -12,6 +12,7 @@ plugins { } group = 'kingstonduo' +version = "latest" apply plugin: 'java' apply plugin: 'eclipse' From aedd28431dc08870dc038d6050bf5ebf466e633c Mon Sep 17 00:00:00 2001 From: Dert1129 Date: Thu, 6 Oct 2022 14:51:41 -0400 Subject: [PATCH 3/3] updated Dockerfile --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1465a31..53c2635 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,5 @@ ARG DEPENDENCY=target/dependency COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib COPY ${DEPENDENCY}/META-INF /app/META-INF COPY ${DEPENDENCY}/BOOT-INF/classes /app -RUN echo '* * * * * java -cp /app:/app/lib/* org.kpmp.FailedPackageChecker' >> /etc/crontabs/root -CMD crond && java -cp /app:app/lib/* org.kpmp.Application \ No newline at end of file +CMD java -cp /app:app/lib/* org.kpmp.eridanus.Application \ No newline at end of file