我已经安装了 Watchtower,并按照文档设置了带有身份验证助手的私有注册表身份验证。在调试模式下,我看到它记录了一条消息,表明已获得身份验证值,但随后它无法使用“没有基本身份验证凭据”提取图像。检查身份验证值,它只是我配置中的主机名,没有凭据。我验证了在主机系统(Raspbian)上,我能够使用相同的 docker 配置提取新版本,而无需执行任何自定义身份验证,一切都可以使用相同的二进制文件开箱即用。
这是我的码头配置:
{
"auths" : {
"0000000000.dkr.ecr.us-east-1.amazonaws.com" : {}
},
"credHelpers": {
"0000000000.dkr.ecr.us-east-1.amazonaws.com": "ecr-login"
}
}
这是我的码头工人撰写:
version: "3"
services:
cavo:
image: 0000000000.dkr.ecr.us-east-1.amazonaws.com/test:1
ports:
- "8080:80"
restart: always
watchtower:
image: containrrr/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /root/.docker/config.json:/config.json
- /usr/bin/docker-credential-ecr-login:/bin/docker-credential-ecr-login
environment:
- AWS_REGION=us-east-1
- AWS_ACCESS_KEY_ID=AAAAAAAAAAAAA
- AWS_SECRET_ACCESS_KEY=aaaaaaaaaaaaaaa
command: --debug --interval 30
restart: always
当瞭望塔尝试检查新图像时,这里是日志文件:
watchtower_1 | time="2019-12-25T22:49:34Z" level=debug msg="Pulling 0000000000.dkr.ecr.us-east-1.amazonaws.com/test:1 for /root_test_1"
watchtower_1 | time="2019-12-25T22:49:34Z" level=debug msg="Loaded auth credentials { 0000000000.dkr.ecr.us-east-1.amazonaws.com } from /config.json"
watchtower_1 | time="2019-12-25T22:49:34Z" level=debug msg="Got auth value: eyJzZXJ2ZXJhZGRyZXNzIjoiMDAwMDAwMDAwMC5ka3IuZWNyLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tIn0="
watchtower_1 | time="2019-12-25T22:49:34Z" level=debug msg="Got image name: 0000000000.dkr.ecr.us-east-1.amazonaws.com/test:1"
watchtower_1 | time="2019-12-25T22:49:35Z" level=debug msg="Error pulling image 0000000000.dkr.ecr.us-east-1.amazonaws.com/sump-pump-v2:1, Error response from daemon: Get https://0000000000.dkr.ecr.us-east-1.amazonaws.com/v2/test/manifests/1: no basic auth credentials"
watchtower_1 | time="2019-12-25T22:49:35Z" level=info msg="Unable to update container /root_test_1. Proceeding to next."
watchtower_1 | time="2019-12-25T22:49:35Z" level=debug msg="Error response from daemon: Get https://0000000000.dkr.ecr.us-east-1.amazonaws.com/v2/test/manifests/1: no basic auth credentials"
解压 auth 值,它只有主机名。没有存储库凭据。
我试图遵循“ Credential helpers ”文档,但我不确定我是否理解上述 Dockerfile 的所属位置。
任何正确方向的指针将不胜感激。谢谢!