Jenkinsfile: Publish Docker Image to Amazon ECR

Problem You pushed a docker image to AWS ECR and get denied: requested access to the resource is denied error. stage(‘Publish Docker Image to AWS’){ steps { script { //build image commit_id = readFile(‘commit_id’).trim() def image = docker.build(“$ECR_REPO_NAME:$commit_id”) //push image docker.withRegistry( “https://$ECR_REGISTRY”, ECR_CRED) { echo ‘ Pushing Latest docker image’ image.push() } } } }

Read More