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.

  • Docker: execute a program that requires tty
  • How to inform Maven/JVM options for S2I build in OpenShift3
  • Ansible Variables only X times per host
  • docker push to dockerhub private repo sometimes pushes existing layer again (ubuntu base layer)
  • Why log settings don't work without setting --log-driver option while service creation?
  • boot2docker startup script to mount local shared folder with host
  • Not use docker-machine
  • sonar-scanner- throws java.lang.ExceptionInInitializerError inside docker container
  • Gitlab Pipelines Stages take hours or days to show result (passed, failed) - docker, node app
  • unable to connect through SSH key to bluemix container
  • Forbidden in oficial image Docker PHP
  • Passing or setting password parameter to mercurial during docker build
  • 2 Solutions collect form web for “Linux Container vs JVM”

    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 and helpful.

    They are significantly different.
    A java program is a process on the OS kernel. A JVM is running, which executes the bytecode that is the java program. The java program could use any amount of resources (depending upon the JVM limits), and use the operating system in any way it likes.

    A docker container is an implementation of Operating System Virtualization. The easiest way to understand containers would be that it provides an independent slice of the operating system using virtualization. The container’s resource usage can be limited and can be isolated so that it is unaware of any part of the system outside the container, Like the Filesystem, the network, the processes. The kernel provides specific features – CGroups and Namespaces which are used to provide containers.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.