micahhausler / container-transform

Transforms docker-compose, ECS, and Marathon configurations
MIT License
1.41k stars 148 forks source link

how to generate outer json properties? #14

Closed jbasrai closed 9 years ago

jbasrai commented 9 years ago

When I run container-transform on my docker-compose.yml, I only get the array for containerDefinitions generated.

docker-compose.yml

runner:
    image: ceroic/scrapyd
    ports:
        - "6800:6800"
    environment:
        - CLOSESPIDER_ITEMCOUNT=20
        - DOWNLOAD_DELAY=10
        - ELASTICSEARCH_SERVER=localhost
        - ELASTICSEARCH_PORT=9200

translated to:

[
    {
        "environment": [
            {
                "name": "CLOSESPIDER_ITEMCOUNT", 
                "value": "1"
            }, 
            {
                "name": "ELASTICSEARCH_PORT", 
                "value": "9200"
            }, 
            {
                "name": "DOWNLOAD_DELAY", 
                "value": "2"
            }, 
            {
                "name": "ELASTICSEARCH_SERVER", 
                "value": "localhost"
            }
        ], 
        "portMappings": [
            {
                "containerPort": 6800, 
                "hostPort": 6800
            }
        ], 
        "image": "ceroic/scrapyd", 
        "name": "runner", 
        "essential": true
    }
]

What do I have to change to get the whole ECS task definition to be generated, including family and containerDefinitions key?

micahhausler commented 9 years ago

Hey, I've got an alpha out right now that does that and haven't released that yet. You can try it out with:

pip install container-transform==0.5.0a2

and that should work!

jbasrai commented 9 years ago

So awesome. Thanks for this great tool!

micahhausler commented 9 years ago

I released 0.5.0 today, let me know if you have any issues!