[英]Docker Image can't push to ECR via Jenkins Pipeline & docker.withRegistry
I am running jenkins on a aws server Working on a pipeline for building docker images and push to ECR on the same aws account我在 aws 服务器上运行 jenkins 处理用于构建 docker 图像的管道并在同一个 aws 帐户上推送到 ECR
def aws_account = "https://xxxxxx.ecr.us-west-2.amazonaws.com/"
def ecr_credentials = "iam-role-arn for ecr"
docker.withRegistry(aws_account + "${ecr_repository_name}", "ecr:us-west-2:${ecr_credentials}") {
docker.image(customImage).push()
}
While pushing I am getting below error tcp:lookup is pointing to the account number itself在推动时,我遇到错误 tcp:lookup 指向帐号本身
Error: docker.service Mar 04 10:46:13 ip-x-xxx-x-xxx dockerd[921]: time="2021-03-04T10:46:13.989576275Z" level=error msg="Handler for POST /v1.41/auth returned error: Get https://yyyyyyy.ecr.us-west-2.amazonaws.com/v2/ : dial tcp: lookup yyyyyyy.ecr.us-west-2.amazonaws.com: no such host"错误: docker.service Mar 04 10:46:13 ip-x-xxx-x-xxx dockerd[921]: time="2021-03-04T10:46:13.989576275Z" level=error msg="POST/ v1.41/auth returned error: Get https://yyyyyyy.ecr.us-west-2.amazonaws.com/v2/ : dial tcp: lookup yyyyyyy.ecr.us-west-2.amazonaws.com: no such主持人”
The name is wrong名字错了
def aws_account = "https://xxxxxx.ecr.us-west-2.amazonaws.com/" def aws_account = "https://xxxxxx.ecr.us-west-2.amazonaws.com/"
It should be something like它应该是这样的
def aws_account = "https://1234567890.dkr.ecr.us-west-2.amazonaws.com"
def ecr_credentials = "iam-role-arn for ecr"
docker.withRegistry(aws_account + "${ecr_repository_name}", "ecr:us-west-2:${ecr_credentials}") {
docker.image(customImage).push()
}
Pushing to ECR Using Jenkins Pipeline Plugin 使用 Jenkins 管道插件推送到 ECR
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.