【发布时间】:2016-11-07 20:12:56
【问题描述】:
我正在尝试将使用 Docker 构建的 rails 应用程序部署到 Elastic Beanstalk 的多容器服务。我的 Dockerrun.aws.json 目前看起来像:
{
"AWSEBDockerrunVersion": 2,
"volumes": [
{
"name": "myapp",
"host": {
"sourcePath": "/var/app/current"
}
},
{
"name": "myapp-redis",
"host": {
"sourcePath": "/var/app/current/myapp-redis"
}
},
{
"name": "myapp-postgres",
"host": {
"sourcePath": "/var/app/current/myapp-postgres"
}
}
],
"authentication": {
"bucket": "myapp",
"key": "config.json"
},
"containerDefinitions": [
{
"name": "redis",
"image": "redis:3.0.5",
"environment": [
{
"name": "Container",
"value": "redis"
}
],
"portMappings": [
{
"hostPort": 6379,
"containerPort": 6379
}
],
"essential": true,
"memory": 128,
"mountPoints": [
{
"sourceVolume": "myapp-redis",
"containerPath": "/var/lib/redis/data",
"readOnly": false
}
]
},
{
"name": "postgres",
"image": "postgres:9.4.5",
"environment": [
{
"name": "Container",
"value": "postgres"
}
],
"portMappings": [
{
"hostPort": 5432,
"containerPort": 5432
}
],
"essential": true,
"memory": 128,
"mountPoints": [
{
"sourceVolume": "myapp-postgres",
"containerPath": "/var/lib/postgresql/data",
"readOnly": false
}
]
},
{
"name": "myapp",
"image": "myrepo/myapp:latest",
"environment": [
{
"name": "Container",
"value": "myapp"
}
],
"essential": true,
"memory": 128,
"mountPoints": [
{
"sourceVolume": "myapp",
"containerPath": "/myapp",
"readOnly": false
}
]
}
]
}
我的config.json 文件位于存储桶myapp/config.json 中,格式如下:
{
"https://index.docker.io/v1/": {
"auth": "mylongauthtokenhere",
"email": "me@myemail.com"
}
}
当我指向 "image": "myrepo/myapp:latest", 行的公共存储库时,此设置有效,但是当我尝试使用此配置进行初始化时,我收到错误:err="Error: image myrepo/myapp:latest not found" 和 ERROR [Instance: i-913b2004] Command failed on instance. Return code: 1 Output: 'Failed to start ECS task after retrying 2 times.'
我还尝试了几种不同的方式配置 config.json,但没有成功。对此的任何帮助将不胜感激!
【问题讨论】:
-
明确一点,当您使用此配置指向公共存储库时,它可以工作,但如果您将其指向私有存储库,则会出现错误(其他一切都相同)?
-
是的,据我所知,唯一挂断的就是这是一个私人仓库。
-
你能把auth的完整内容我想看看它嵌套了多远吗?您的配置来自 1.7 docker 还是 1.6 及更早版本?
-
我在我的机器上使用 docker 1.10.3。 EB 仪表板显示 1.9.1
-
查看我帖子的更新。 EB 仍然想要旧格式的 auth 文件,而不是 docker 1.7 或更高版本生成的文件。
标签: amazon-web-services docker amazon-elastic-beanstalk