You don’t “need” docker at all. But it makes things easier. You can build any application as a self-contained executable or directory with executable and related files. But it turned out it was not enough.
Imagine keycloak. It's classical enterprise Java application with database. You can deploy it as WAR file with configured JDBC connection.
But people who use keycloak often have little idea what Java is. They write code in Go and call Keycloak interfaces via REST API. They just need to start that thing and connect to some database.
With docker they'll get it up and running in minutes.
That leaves the whole setup of the application server that the EAR file needs out of the picture though. That stuff is not specified declaritively anywhere in the EAR, so it's just a wildcard that can make your application work or not work depending on version and configuration.
Apparently those advocating stuff like Docker for OS agnostic languages never saw them in first place, probably busy in kindergarten and now pushing for Docker + WASM instead, 10 years later.
Yep. The last company I was at was a Java shop. We had no need for containers. We built a fat jar for each "service." A deploy was little more than copying that fat jar + configuration file over. Multiple services easily ran without Docker.
This approach was way lighter weight than pushing enormous images around.