Best Practices

  • Use official Docker images as base images
  • Use specific image version
  • Use small sized official images
  • Optimize caching image layers
  • Use .dockerignore to exclude unwanted files and folders
  • Make use of Multi-Stage builds
  • Use the least priileged user to run the container
  • Scan your images for vulnarabilities

Last modified July 16, 2024: code refactored (add6d20)