cloud-init is an industry standard tool to initialize instance with cross-platform and multi-distribution characteristics. Explains how it works in AWS.
This is a guide how to find public available layers in github, then create your own layer and publish it in AWS by either EC2 or Docker container.
How to cope with the permission problems when we use bind mounts in Docker. There are 3 ways to solve the problems.