docker-java 支持unix socket调用的
DefaultDockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder().withDockerHost(
"unix:///var/run/docker.sock").build();
dockerClient = DockerClientBuilder.getInstance(config).build();
如果要开启远程调用,要把这个unix socket挂成tcp监听端口
详见:
Docker on Mac上的Remote API 远程控制