mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 06:45:49 +00:00
Docker setup
Docker setup
This commit is contained in:
parent
26bdc4ccaa
commit
4fd3a9f5e2
1 changed files with 12 additions and 4 deletions
16
jenkinsfile
16
jenkinsfile
|
@ -42,9 +42,17 @@ node {
|
||||||
server.upload(uploadSpec)
|
server.upload(uploadSpec)
|
||||||
}
|
}
|
||||||
stage('Petclinic Docker Image') {
|
stage('Petclinic Docker Image') {
|
||||||
sh "sudo docker build --build-arg JAR_FILE_PATH=/var/lib/jenkins/workspace/sample/target/*.war -t sandeepds2002/petclinic ."
|
docker.withRegistry('https://hub.docker.com/', 'credentials-id') {
|
||||||
sh "sudo docker push sandeepds2002/petclinic"
|
|
||||||
sh "sudo rm -r /var/lib/jenkins/workspace/sample/target/spring-petclinic.jar"
|
def customImage = docker.build("petclinic")
|
||||||
sh "sudo docker rmi -f sandeepds2002/petclinic"
|
|
||||||
|
/* Push the container to the custom Registry */
|
||||||
|
customImage.push()
|
||||||
|
}
|
||||||
|
|
||||||
|
//sh "sudo docker build --build-arg JAR_FILE_PATH=/var/lib/jenkins/workspace/sample/target/*.war -t sandeepds2002/petclinic ."
|
||||||
|
//sh "sudo docker push sandeepds2002/petclinic"
|
||||||
|
//sh "sudo rm -r /var/lib/jenkins/workspace/sample/target/spring-petclinic.jar"
|
||||||
|
//sh "sudo docker rmi -f sandeepds2002/petclinic"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue