ECR Docker errors in Jenkins pipelines

0

We are seeing random ECR docker errors in our Jenkins pipelines.

There are two types of errors noticed 1) ERROR: Timeout after 180 seconds 2) failed to export image: failed to set parent sha256:abcd: unknown parent image ID sha256:abcd.

As per few suggestions, I tried to introduce a retry mechanism for error 1. And there are several suggestions for the second issue, increasing disc space, performing docker prune, changing docker version etc.,

Please help in understanding the root causes of the issues and suggest how this can be fixed temporarily on the pipelines.

pipeline{
    agent any
    stages{
        stage('POC') {
            steps{
                script{
                    withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', credentialsId: 'credId']]) {
	                    docker.withRegistry("https://xxxx.dkr.ecr.us-east-1.amazonaws.com") {
	                        sh("`aws ecr get-login --no-include-email --region us-east-1`")
	                        docker.image('xxxx.dkr.ecr.us-east-1.amazonaws.com/my-image:my-version').inside{
	                          script{
	                            sh("echo6 'POC'")
	                          }
	                        }
	                    }
	                }
                }
            }
        }
    }
}

This is a follow up to https://repost.aws/questions/QUIexgvHvYQvyD6i2ExcY-6Q/ecr-login-token-expiry-reauthentication-suggestions

asked 10 months ago80 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions