2016-07-05 5 views
1

DockerでビルドされたレールアプリケーションをElastic Beanstalkのマルチコンテナサービスに配備しようとしています。私config.jsonファイルがバケツmyapp/config.jsonにあり、同じようにフォーマットされDockerrun.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 
     } 
     ] 
    } 
    ] 
} 

::私は"image": "myrepo/myapp:latest",ラインの公開リポジトリをポイントすると、この設定が機能する

{ 
    "https://index.docker.io/v1/": { 
    "auth": "mylongauthtokenhere", 
    "email": "[email protected]l.com" 
    } 
} 

のように私のDockerrun.aws.jsonは現在に見えます私も運を持ついくつかの異なる方法config.json configuing試した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.'

:私はこの設定を初期化しようとすると、私はエラーを取得します。これについての助けがあれば、大歓迎です!

+0

パブリック・リポジトリを指すこの設定を使用すると、それは機能しますが、プライベート・リポジトリを指し示すとエラーが発生します(他のすべては同じです) ? – Ray

+0

ええ、私がそれをぶら下げている唯一のことを私が言うことができる限り、それは私的なレポであるという事実です。 – Raskolnikov

+0

authの完全な内容を入れて、入れ子になっているかどうか確認したいですか?あなたの設定は1.7ドッカーか1.6&以前ですか? – Ray

答えて

1

更新:OPが必要な特定の役割を発見しました。 aws-elasticbeanstalk-ec2-roleには、AmazonS3ReadOnlyAccess ポリシーが必要でした。

EBはサービスロールによって実行されます。これらのロールには、S3から資格ファイルを取得して取得するための適切な権限が必要です。http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts-roles.html

また、Docker 1.7以降をローカルで使用していると推測しています。

ドッカー1.7以降のログインは、次のように資格ファイルconfig.jsonを生成します。欠落している外側の認証ブロック

{ 
    "server" : 
    { 
     "auth" : "auth_token", 
     "email" : "email" 
    } 
    } 

お知らせ:

{ 
"auths" : 
{ 
    "server" : 
    { 
     "auth" : "auth_token", 
     "email" : "email" 
    } 
    } 
} 

Elastic Beanstalkではこのようなだけ古いconfigオブジェクトフォーマットをしたいために使用されます?

または多分それは他の方法で回避だとElasticBeanstalkが新しいフォーマットを期待しているあなたは、あなたのOPに注意してEBがドッキングウィンドウ1.9.1

を使用している場合は、このファイルを編集し、EBに再アップロードしようとすることができます。 http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker.container.console.html#docker-images-private

+0

これは私のファイルが現在のように見えますか?私の質問の2番目のコードブロックに記載されているように?それともそれはまだ間違って見えますか? – Raskolnikov

+0

@Raskolnikov反対のことをして、外側の認証ブロックをjsonに追加してください。彼らのドキュメントは変わっていると思われますが、おそらく新しい設定フォーマットを受け入れるかもしれません。 – Ray

+0

これを試してみてください – Raskolnikov

関連する問題