The new Docker daemon uses port: 2376 with TLS enable by default. Sometimes I want to play with curl
on the old plain http port 2375. The trick is: use socat
in a container to proxy the unix socket
to a real port.
docker run -d \
--volume /var/run/docker.sock:/var/run/docker.sock \
--name docker-http \
deb socat -d -d TCP-L:2375,fork UNIX:/var/run/docker.sock
DOCKER_URL=$(docker inspect -f "{{.NetworkSettings.IPAddress}}" docker-http):2375
curl $DOCKER_URL/_ping
reference: https://gist.github.com/nuxlli/7553996