【发布时间】:2017-06-30 05:53:48
【问题描述】:
按照此处的说明从 Elastic Beanstalk 连接到私有 docker hub 容器,但它顽固地拒绝工作。似乎在 Docker 1.12 中调用 docker login 时生成的文件没有电子邮件属性,但听起来 aws 期望它,所以我创建了一个名为 dockercfg.json 的文件,如下所示:
{
"https://index.docker.io/v1/": {
"auth": "Y2...Fz",
"email": "c...n@gmail.com"
}
}
我的 Dockerrun.aws.json 文件的相关部分如下所示:
"Authentication": {
"Bucket": "elasticbeanstalk-us-west-2-9...4",
"Key": "dockercfg.json"
},
我已将文件上传到 S3 存储桶的根目录。为什么我仍然会收到Error: image c...6/w...t:23 not found. Check snapshot logs for details. 的错误消息,我确信名称是正确的,并且如果它是公共存储库,这将起作用。完整的错误如下。如果有影响,我将从 GitHub 使用 Circle CI 进行部署,很乐意提供所需的任何其他信息。
INFO: Deploying new version to instance(s).
WARN: Failed to pull Docker image c...6/w...t:23, retrying...
ERROR: Failed to pull Docker image c...6/w...t:23: Pulling repository docker.io/c...6/w...t
Error: image c...6/w...t:23 not found. Check snapshot logs for details.
ERROR: [Instance: i-06b66f5121d8d23c3] Command failed on instance. Return code: 1 Output: (TRUNCATED)...b-project
Error: image c...6/w...t:23 not found
Failed to pull Docker image c...6/w...t:23: Pulling repository docker.io/c...6/w...t
Error: image c...6/w...t:23 not found. Check snapshot logs for details.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03build.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
ERROR: Unsuccessful command execution on instance id(s) 'i-06b66f5121d8d23c3'. Aborting the operation.
ERROR: Failed to deploy application.
ERROR: Failed to deploy application.
编辑:这是完整的 Dockerrun 文件。请注意,%BUILD_NUM% 只是一个 int,我可以验证它是否有效。
{
"AWSEBDockerrunVersion": "1",
"Authentication": {
"Bucket": "elasticbeanstalk-us-west-2-9...4",
"Key": "dockercfg.json"
},
"Image": {
"Name": "c...6/w...t:%BUILD_NUM%",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "8080"
}
]
}
编辑:另外,如果我将此 Docker Hub 容器公开,我已经验证了它是否有效。
【问题讨论】:
-
你能发布整个 Dockerrun.aws.json 文件吗?
-
是的,谢谢,刚刚做了
-
一切似乎都是正确的。您能否确认 EB 具有访问该 S3 存储桶所需的所有 IAM 权限?
-
仔细检查,我使用访问密钥的用户具有完全 S3 访问权限和完全 Elastic Beanstalk 访问权限
-
Check snapshot logs for details那里面有什么?
标签: amazon-web-services docker amazon-s3 amazon-elastic-beanstalk