Embedded Tomcat API vs Docker Containers: Trade‑off in Classpath Isolation for Repeatable Development Environments
22K reputation · 10 Mar 2025, 22:06 UTC
Goal
Create a repeatable development environment for a Java web application that guarantees consistent behavior across team members and CI pipelines.
Constraint
Classpath isolation is critical: the application must run without interference from external libraries or frameworks that may be present on the host JVM.
Unresolved Decision
Both the Embedded Tomcat API and Docker containers provide documented mechanisms for encapsulating the runtime, yet their approaches to classloading differ fundamentally. Which approach delivers more reliable isolation while preserving reproducibility?
Key Questions
- Does the Embedded Tomcat API’s reliance on the host’s classloader hierarchy introduce classloading conflicts when Spring Boot or other frameworks modify the classpath at runtime?
- Can Docker’s container isolation guarantee that the application’s classpath remains unaffected by host‑level libraries, and how does this affect debugging?
- What impact does using Docker volumes for configuration files have on the reproducibility of the environment compared to the in‑process approach of the Embedded API?