18. BEST PRACTICES
➤ Use official base images (stand on the shoulders of giants)
➤ Be aware of unofficial (cowboy) images
➤ Use specific versions of base images
➤ Keep images small in size (remove tools that are not needed)
➤ Optimize layers (when you're done)
➤ Think about readability (use "" to continue on a new line)
➤ Update often (scheduled builds)
19. BEST PRACTICES
➤ Mount source code (possibly use ':cached')
➤ Mount local config/cache (Composer, NPM)
➤ Create separate application and build/devtools containers
➤ Run tools as yourself (uid/gid)
➤ Create helper scripts for containerized tools
➤ Log to stdout
20. BEST PRACTICES
➤ Leave out dev tools (debug tools, package managers, etc.)
➤ Leave out unnecessary files (tests, documentation, dev related
config)
➤ Do not keep state (that you can't rebuild)
➤ Consider running a container as read only
➤ Run as non root user
➤ Use health checks
➤ Spend time on setting up logging