adding docker login

This commit is contained in:
areeqakbr 2025-02-25 11:23:41 +07:00
parent eb5315a3fa
commit e77efc5297
1 changed files with 10 additions and 0 deletions

10
Jenkinsfile vendored
View File

@ -45,6 +45,16 @@ spec:
} }
} }
stage('Login to Docker Registry') {
steps {
container('docker') {
withCredentials([usernamePassword(credentialsId: 'DOCKERUSRPASS', usernameVariable: 'DOCKER_USER', passwordVariable: 'DOCKER_PASS')]) {
sh "docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} ${REGISTRY_URL}"
}
}
}
}
stage('Build and Push Docker Image') { stage('Build and Push Docker Image') {
steps { steps {
container('docker') { // Runs in the Docker container inside Kubernetes container('docker') { // Runs in the Docker container inside Kubernetes