First cut at docker builds with kaniko
Some checks failed
Homelab/java-spring-microservice/pipeline/head There was a failure building this commit
Some checks failed
Homelab/java-spring-microservice/pipeline/head There was a failure building this commit
This commit is contained in:
parent
f42c332757
commit
c56e6b0349
11
Jenkinsfile
vendored
11
Jenkinsfile
vendored
@ -6,6 +6,14 @@ podTemplate(label: label, containers: [
|
|||||||
image: 'maven:3.8.4-openjdk-11',
|
image: 'maven:3.8.4-openjdk-11',
|
||||||
command: 'sleep',
|
command: 'sleep',
|
||||||
args: '30d'
|
args: '30d'
|
||||||
|
),
|
||||||
|
containerTemplate(
|
||||||
|
name: 'kaniko',
|
||||||
|
image: 'gcr.io/kaniko-project/executor:latest',
|
||||||
|
command:
|
||||||
|
- sleep
|
||||||
|
args:
|
||||||
|
- 99d
|
||||||
)
|
)
|
||||||
]) {
|
]) {
|
||||||
node(label) {
|
node(label) {
|
||||||
@ -21,6 +29,9 @@ podTemplate(label: label, containers: [
|
|||||||
archiveArtifacts artifacts: 'target/*.jar', followSymlinks: false
|
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
4
src/Dockerfile
Normal 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"]
|
||||||
Loading…
Reference in New Issue
Block a user