While it is not possible to run Docker in Docker (DIND) on Amazon ECS with AWS Fargate, for those building with the new Amazon ECS Managed Instances, please find the steps below to run Docker in Docker via a privileged Task on ECS MI.
We assume the following resources already exist: ECS Cluster, ECS Managed Instances Capacity Provider, ECS Task Execution Role, VPC (with subnets), VPC Security Group (no ingress rules required).
AWS_ACCOUNT_ID="111222333444"