- docker登陆账号docker hub
docker run -d --name socat --restart always -p 2375:2375 -v /var/run/docker.sock:/var/run/docker.sock alpine/socat tcp-listen:2375,fork,reuseaddr unix-connect:/var/run/docker.sock
- vim .bash_profile
export DOCKER_HOST=tcp://localhost:2375
- source .bash_profile
- curl localhost:2375/version
================
如果失败了,出现了"Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running?"
unset DOCKER_HOST
unset DOCKER_TLS_VERIFY
unset DOCKER_TLS_PATH
docker ps
==========
借鉴资料: