使用Python将标签添加到Ecr中的Docker映像

时间:2018-10-15 22:10:47

标签: python amazon-web-services docker boto3 aws-ecr

我正在尝试登录docker ecr repo,修改docker image标签。但是,即使登录到docker repo后,我仍然遇到以下错误。请帮助我解决问题,在此先谢谢

    repoUrl = "{0}.dkr.ecr.us-east-2.amazonaws.com/{1}".format(
                  str(self.ecr_client.describe_images(repositoryName=repoName).get('imageDetails')[0].get('registryId')),
                  repoName)
    token = self.ecr_client.get_authorization_token()
    username, password = base64.b64decode(token['authorizationData'][0]['authorizationToken']).decode().split(':')
    registry = token['authorizationData'][0]['proxyEndpoint']
    login = self.docker_client.login(username, password, registry=registry)
    self.docker_client.images.pull(repoUrl, tag='latest')

错误:

docker.errors.APIError: 500 Server Error: Internal Server Error ("Get https://XXXXdkr.ecr.us-east-2.amazonaws.com/v2/XXXX/manifests/latest: no basic auth credentials")

0 个答案:

没有答案