Search code examples
javadockerlinux-containersjava-10

Does Java 10's newly added support for Docker include support for other container technologies?


Improvements for running a JVM in Docker are awesome additions to Java 10.

Some of the improvements I am referring to are:

  • memory limits set by the container
  • available cpus set by the container
  • cpu constraints set by the container
  • the ability for the JVM to know it is running in a container

Does anyone know if these improvements are specific to just Docker, or can they be realized using other containers such as Warden, rkt, and/or others?


Solution

  • Pretty much all container runtimes on linux are just rube goldberg machines - docker is one of those contraptions - built from the same low level building blocks: namespaces, cgroups, capabilities, virtual network devices and various other kernel features.

    The JVM probes those underlying features and thus is mostly independent of the abstractions sitting above that. I say mostly because it may rely on things like procfs being present in the mount namespace to do the probing and in principle containers without those can be created.