From 1f598ff6b2839d9aa24193b540c2a4c0a362f259 Mon Sep 17 00:00:00 2001 From: Viktoriia Karpenko Date: Thu, 12 Dec 2024 17:11:39 +0200 Subject: [PATCH] Edit Jenkinsfile --- Jenkinsfile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index cbbefc3ed..1440ea4ab 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,14 +24,9 @@ pipeline { } } stage ('Creating Docker image') { - agent { - docker { - image 'docker:latest' - } - } steps { - sh 'docker build -t vkarpenko02/spring-petclinic:${GIT_COMMIT} .' - sh 'docker push vkarpenko02/mr' + 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}' } } }