Skip to content

Instantly share code, notes, and snippets.

Best Practices to build Java Container

  1. Use explicit and deterministic Docker base image tags
  2. Install only what you need in production in the Java container image
  3. Find and fix security vulnerabilities in your Java Docker image
  4. Use multi-stage builds
  5. Don’t run Java apps as root
  6. Properly handle events to safely terminate a Java application
  7. Gracefully tear down Java applications
  8. Use .dockerignore

Best Practices to build Java Container

  1. Use explicit and deterministic Docker base image tags
  2. Install only what you need in production in the Java container image
  3. Find and fix security vulnerabilities in your Java Docker image
  4. Use multi-stage builds
  5. Don’t run Java apps as root
  6. Properly handle events to safely terminate a Java application
  7. Gracefully tear down Java applications
  8. Use .dockerignore