The number one advice should be to use a linter. The number two advice should be to use an image security scanner. These tools combined will prevent most issues. Integrate them with CI to enforce a common set of best practices across an organization and to prevent security bike shedding.