解决方案
安装 socat
brew install socat
使用 socat 将 unix socket 代理到 tcp 端口
socat TCP-LISTEN:2375,range=127.0.0.1/32,reuseaddr,fork UNIX-CLIENT:/var/run/docker.sock
设置环境变量 DOCKER_HOST
export DOCKER_HOST=tcp://127.0.0.1:2375
镜像构建成功
[INFO] --- dockerfile-maven-plugin:1.4.13:build (shardingsphere-proxy-bin) @ shardingsphere-integration-test-fixture ---
[INFO] dockerfile: null
[INFO] contextDirectory: /Users/wuweijie/IdeaProjects/shardingsphere/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture
[INFO] Building Docker context /Users/wuweijie/IdeaProjects/shardingsphere/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture
[INFO] Path(dockerfile): null
[INFO] Path(contextDirectory): /Users/wuweijie/IdeaProjects/shardingsphere/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture
[INFO]
[INFO] Image will be built as apache/shardingsphere-proxy-test:latest
[INFO]
[INFO] Step 1/11 : FROM openjdk:8-jdk-alpine
[INFO]
[INFO] Pulling from library/openjdk
[INFO] Image 0362ad1dd800: Pulling fs layer
[INFO] Image 571218f61883: Pulling fs layer
[INFO] Image abe576d65b4c: Pulling fs layer
[INFO] Image 571218f61883: Downloading
[INFO] Image 571218f61883: Verifying Checksum
[INFO] Image 571218f61883: Download complete
[INFO] Image 0362ad1dd800: Downloading
[INFO] Image abe576d65b4c: Downloading
[INFO] Image 0362ad1dd800: Verifying Checksum
[INFO] Image 0362ad1dd800: Download complete
[INFO] Image 0362ad1dd800: Extracting
[INFO] Image 0362ad1dd800: Pull complete
[INFO] Image 571218f61883: Extracting
[INFO] Image 571218f61883: Pull complete
[INFO] Image abe576d65b4c: Verifying Checksum
[INFO] Image abe576d65b4c: Download complete
[INFO] Image abe576d65b4c: Extracting
[INFO] Image abe576d65b4c: Pull complete
[INFO] Digest: sha256:94792824df2df33402f201713f932b58cb9de94a0cd524164a0f2283343547b3
[INFO] Status: Downloaded newer image for openjdk:8-jdk-alpine
[INFO] ---> e4105db9d469
[INFO] Step 2/11 : ARG APP_NAME
[INFO]
[INFO] ---> Running in a45c265a7eff
[INFO] Removing intermediate container a45c265a7eff
[INFO] ---> 46a87b168ea2
[INFO] Step 3/11 : ADD target/${APP_NAME}.tar.gz /opt
[INFO]
[INFO] ---> a931814