Does ECS task definition support volume mapping syntax? Does ECS task definition support volume mapping syntax? docker docker

Does ECS task definition support volume mapping syntax?


Yes, of course, ECS support docker socket mounting, but the syntax is bit different. Add DOCKER_HOST environment variable in the task definition and source path should start with //.

 "volumes": [        {            "name": "docker",            "host": {                "sourcePath": "//var/run/docker.sock"            }        }    ]

The // worked in case of AWS ecs.

Also, you need to add DOCKER_HOST environment variable in your task definition.

            "environment": [                {                    "name": "DOCKER_HOST",                    "value": "unix:///var/run/docker.sock"                }            ]