I use jenkins pipeline to build and push image to my aws registry. I created a related credential, and its type is AWS credential named 'aws_credential'. But I got error message ERROR: Could not find credentials matching aws_credential
. My pipeline is
script.docker.withRegistry(registryUrl, registryCredentialsId) {
def image = script.docker.image(imageName)
image.push()
}
The registryCredentialsId
is 'aws_credential' and registryUrl
is my aws registery url.
It read my credential and login successfully.
Ok, I make a mistake that I even havent install Amazon ECR plugin.