当前位置: 动力学知识库 > 问答 > 编程问答 >

Docker inspect with unix:///var/run/docker.sock (in Java or Scala)

问题描述:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: