add build image main stage

This commit is contained in:
TomPGrid 2025-02-28 14:04:45 +01:00
parent 730a0f69f0
commit d94209914a

17
Jenkinsfile vendored
View file

@ -54,5 +54,22 @@ pipeline {
}
}
}
stage('Build Image Main') {
agent {
docker {
image 'docker:20.10.16'
args '--privileged -u root -v /var/run/docker.sock:/var/run/docker.sock'
}
}
steps {
script {
def docker_image=docker.build("main:8084/spring-petclinic:$GIT_COMMIT")
sh 'docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASS" main:8084'
docker.withRegistry('http://main:8084') {
docker_image.push()
}
}
}
}
}
}