Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux Container vs JVM

What's the big difference between a container running on top of docker and a self contained Java program running on top of the JVM?

I assume both are running directly on a physical linux server without underlying visualization.

like image 217
Taiko Avatar asked Jul 19 '15 22:07

Taiko


People also ask

Is a JVM a container?

Not to mention JVM in the container, which is also a type of VM. To sum it up, we have virtualization, container, and JVM all inside each other, stacked as a nesting doll. A big promise that container technologies give us developers is being able to control the environment for applications to run.

Does Docker use JVM?

But Docker provides the icing on the cake, as it makes your application entirely portable, including the Java JVM. That means no need to worry about which version of the JRE is installed on the host, because the JRE is installed right inside the Docker image itself.

What is the difference between a Docker container and a Linux container?

What is the major difference between Linux and Docker containers? LXC focuses on OS containerization, while Docker thrives on application containerization. Docker is single-purpose application virtualization, and LXC is multi-purpose operating system virtualization.

Are containers faster than virtual machines?

Docker containers are generally faster and less resource-intensive than virtual machines, but full VMware virtualization still has its unique core benefits—namely, security and isolation.


1 Answers

A java program running on top of the JVM will be a single Linux process. The JVM runs inside the process, and interprets (or compiles) the Java byte code in your classes.

A docker container is more heavyweight. There's the docker daemon, the docker container, which is actually a virtualized Linux instance, and then your JVM running under that.

I found https://docs.docker.com/engine/getstarted/step_one/ and https://docs.docker.com/engine/userguide/eng-image/baseimages/ helpful.

like image 87
schtever Avatar answered Oct 01 '22 14:10

schtever