Hacker News new | ask | show | jobs
by mdavid626 87 days ago
I’d be happier if this could run as one binary without Docker. Java is so much harder to setup.
1 comments

Getting Java to run is a base requirement for running most software written in Java.

However, there is a dedicated Dockerfile for creating a native image (Java words for "binary") that shouldn't require a JVM. I haven't tested running the binary myself so it's possible there are dependencies I'm not aware of, but I'm pretty sure you can just grab the binary out of the container image and run there locally if you want to.

It'll produce a Linux image of course, if you're on macOS or Windows you'd have to create a native image for those platforms manually.

Yeah, compare this with downloading single binary approach.

Downloading JDK, setting up the correct env variables, or running Docker, all this is just pain, compared to single binary approach.

Isn't a docker image basically a universal binary at this point? It's a way to ship a reproducible environment with little more config than setting an ENV var or two. All my local stuff runs under a docker compose stack so I have a container for the db, a container for redis, LocalStack, etc
Is it though?

On my Mac Docker runs Linux virtualized. It’s a resource hog.

Compare that with simple native binary.

I'm not saying it's ideal, just saying that's what we've shifted to for repeatable programs. Your Linux "universal" binary certainly won't work on your Mac directly either...