Skip to content

Commit

Permalink
Merge pull request #13 from KPMP/KPMP-1305-dockerify-eridanus
Browse files Browse the repository at this point in the history
implemented docker image push
  • Loading branch information
zwright authored Oct 10, 2022
2 parents d2a5362 + aedd284 commit d55bbf0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
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

CMD java -cp /app:app/lib/* org.kpmp.eridanus.Application
20 changes: 20 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@ buildscript {
}
}

plugins {
id 'com.palantir.docker' version '0.22.1'
}

group = 'kingstonduo'
version = "latest"

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'
Expand Down Expand Up @@ -48,3 +56,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"])
}

0 comments on commit d55bbf0

Please sign in to comment.