Bitbucket管道:Docker登录到私有ECR成功,但pull失败
我是bitbucket管道的新手,在尝试对专用AWS容器注册表(ECR)使用Bitbucket管道:Docker登录到私有ECR成功,但pull失败,docker,bitbucket-pipelines,amazon-ecr,Docker,Bitbucket Pipelines,Amazon Ecr,我是bitbucket管道的新手,在尝试对专用AWS容器注册表(ECR)使用docker服务时遇到了问题。我可以登录,但由于02XXXXX32.dkr.ecr.eu-central-1.amazonaws.com/my_image:latest,存储库不存在或可能需要“docker登录”,因此后续拉取失败。 下面是我的yml文件 image: python:3.7.2 options: docker: true pipelines: custom: docker-build
docker
服务时遇到了问题。我可以登录,但由于02XXXXX32.dkr.ecr.eu-central-1.amazonaws.com/my_image:latest,存储库不存在或可能需要“docker登录”,因此后续拉取失败。
下面是我的yml
文件
image: python:3.7.2
options:
docker: true
pipelines:
custom:
docker-build:
- step:
name: Build Docker Image
caches:
- pip
script:
- apt-get update
- pip install awscli
- aws configure set default.region $AWS_DEFAULT_REGION
- aws configure set aws_access_key_id $AWS_KEY
- aws configure set aws_secret_access_key $AWS_SECRET
- eval $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email --debug --registry-id 02XXXXX32)
- cat /root/.docker/config.json
- docker 02XXXXX32.dkr.ecr.eu-central-1.amazonaws.com/my_image:latest
调试消息显示:
2020-08-28 19:08:43,113 - MainThread - botocore.hooks - DEBUG - Event needs-retry.ecr.GetAuthorizationToken: calling handler <botocore.retryhandler.RetryHandler object at 0x7f3b644d96a0>
2020-08-28 19:08:43,113 - MainThread - botocore.retryhandler - DEBUG - No retry needed.
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
欣赏任何朝正确方向的轻推
{
"auths": {
"02XXXXX32.dkr.ecr.eu-central-1.amazonaws.com": {
"auth": "QLONGTOKENXXX...XXXXNJblpsY25OcGIyNGlPaUl5SWl3aWRIbHdaU0k2SWtSQlZFRmZTMFZaSWl3aVpYaHdhWEpoZEdsdmJpSTZNVFU1T0RZNE5Ea3lNMzA9"
}
},
"HttpHeaders": {
"User-Agent": "Docker-Client/18.09.1 (linux)"
}
}