From 5da907f8b305e45b35b4e7731452791bf1015df7 Mon Sep 17 00:00:00 2001 From: Viktoriia Karpenko Date: Thu, 12 Dec 2024 17:39:02 +0200 Subject: [PATCH] Edit Jenkinsfile --- Jenkinsfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1440ea4ab..f2ddbca4e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,9 @@ pipeline { - agent any + agent { + docker { + image 'docker:latest' + } + } environment { GIT_COMMIT = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim() @@ -25,8 +29,8 @@ pipeline { } stage ('Creating Docker image') { steps { - sh 'docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/workspace -w /workspace docker:20.10 build -t vkarpenko02/spring-petclinic:${GIT_COMMIT} .' - sh 'docker run --rm -v /var/run/docker.sock:/var/run/docker.sock docker:20.10 push vkarpenko02/spring-petclinic:${GIT_COMMIT}' + sh 'docker build -t vkarpenko02/spring-petclinic:${GIT_COMMIT} .' + sh 'docker push vkarpenko02/mr' } } }