Docker has lots of interesting information available via unix:///var/run/docker.sock
I have been able to map this to a port and I can access /containers/json with GET requests to the port. But... this is not exactly secure.
How can I access /containers/json from this raw socket file (in Java or Scala)?
It's not possible to use pure java as there is no framework support for Unix sockets. However, you can use some sort of jni-library for this. Like this one.