First cut at docker builds with kaniko
Some checks failed
Homelab/java-spring-microservice/pipeline/head There was a failure building this commit

This commit is contained in:
Jim Nicholson 2021-12-22 17:35:23 -08:00
parent f42c332757
commit c56e6b0349
2 changed files with 15 additions and 0 deletions

11
Jenkinsfile vendored
View File

@ -6,6 +6,14 @@ podTemplate(label: label, containers: [
image: 'maven:3.8.4-openjdk-11',
command: 'sleep',
args: '30d'
),
containerTemplate(
name: 'kaniko',
image: 'gcr.io/kaniko-project/executor:latest',
command:
- sleep
args:
- 99d
)
]) {
node(label) {
@ -21,6 +29,9 @@ podTemplate(label: label, containers: [
archiveArtifacts artifacts: 'target/*.jar', followSymlinks: false
}
}
container('kaniko') {
sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --insecure --skip-tls-verify --cache-true --destination=docker.thejimnicholson.com/servicedemo/test:latest'
}
}
}
}

4
src/Dockerfile Normal file
View File

@ -0,0 +1,4 @@
FROM openjdk:11-jdk-alpine
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app/jar"]