- To your container, add a new volume
- Name: ‘docker_sock’, source path: ‘/var/run/docker.sock’
- In Storage and Logging section, add new mount point
- Select ‘docker_sock’, container path: ‘/var/run/docker.sock’
And that’s it. No need to give privileged access, and if you run docker commands directly from inside the container there’s no need to change IAM policy.
The EC2 instance is associated with a Container Service cluster using the /etc/ecs/ecs.config file on the instance, in the format ECSCLUSTER=yourcluster_name.
The EC2 instance must also have the ECS agent installed. If you create the instance using the ECS AMI this will be pre-installed (search for AMI called amazon-ecs-optimized).
This configuration can be put in the User Data field:
echo ECS_CLUSTER=your_cluster_name >>/etc/ecs/ecs.config
To find the setting on an instance that already exists: Actions -> Instance Settings -> View/Change User Data
Exact instructions for setting up the EC2 instance properly can be found here: http://docs.aws.amazon.com/AmazonECS/latest/developerguide/launchcontainerinstance.html