Aws ECR Jenkins 插件公共回购支持

问题描述

适用于 Jenkins 的 AWS ECR 插件是否支持对来自 AWS ECR 的公共存储库进行身份验证?

这样的东西...

// Uploading Docker images into AWS ECR Public Repo
  stage('Pushing to ECR') {
    steps{  
      script {
        docker.withServer(
          'tcp://<Docker-Host>:2376','Docker_Server_Auth'
        ) 
        **{
          docker.withRegistry( 
            'https://public.ecr.aws/<alias>','ecr-public:us-east-1:Aws_Credentials'
          )  
          {
            myImage.push("v13")
          }
        }**
      }    
    }
  }

上面的管道代码验证失败,抛出错误'Failed to authentication'

使用私有回购插件可以像下面的管道代码一样工作和验证

//Pushing to ECR Private Repo
stage('Pushing to ECR') {
  steps{
    script {
      docker.withServer(
        'tcp://<docker-host>:2376','Docker_Server_Auth'
        ) 
        **{
        docker.withRegistry( 
          'https://<acc-id>.dkr.ecr.ap-south-1.amazonaws.com','ecr:ap-south-1:Aws_Credentials'
        )  
        {
        myImage.push("v13")
        }
      }**
    }
  }
}

使用 sh 'aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/' 在管道内工作

有什么方法可以像我们使用私有仓库一样使用 ECR 插件验证 ECR 公共仓库吗??

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)