Greg Miller
Greg Miller

Reputation: 1084

Invalid Dockerrun.aws.json file

I tried using this package to generate a working Dockerrun.aws.json file. However, I'm running into some issues.

Dockerrun.aws.json

{
    "containerDefinitions": [
        {
            "command": [
                "./wait-for-it.sh",
                "db:5432",
                "--",
                "./EXECUTABLE"
            ],
            "essential": true,
            "image": "gregpmillr/IMG",
            "memory": 512,
            "links": [
                "db"
            ],
            "name": "app",
            "portMappings": [
                {
                    "containerPort": 8080,
                    "hostPort": 443
                }
            ]
        },
        {
            "environment": [
                {
                    "name": "POSTGRES_DB",
                    "value": "db"
                },
                {
                    "name": "POSTGRES_USER",
                    "value": "dbuser"
                },
                {
                    "name": "POSTGRES_PASSWORD",
                    "value": "dbpw"
                }
            ],
            "essential": true,
            "image": "postgres",
            "memory": 512,
            "name": "db",
            "portMappings": [
                {
                    "containerPort": 5432,
                    "hostPort": 6000
                }
            ]
        }
    ],
    "family": "",
    "volumes": []
}

After running eb deploy I get the error:

ERROR Invalid Dockerrun.aws.json version, abort deployment

Any ideas why this may be incorrect?

Upvotes: 1

Views: 1798

Answers (1)

David Z.
David Z.

Reputation: 231

Elastic Beanstalk Dockerrun.aws.json for multi-container Docker setups must include a key value pair for "AWSEBDockerrunVersion": 2.

Also, I don't believe "family" or "containerDefinitions.command" are supported for Elastic Beanstalk. It looks like you've created a task definition for Amazon ECS, a service that differs in configuration and deployment from Elastic Beanstalk.

Upvotes: 2

Related Questions