Used to work primary using docker on my laptop, but been working on some bigger applications that need to be run on beafier machines, so just set environment variable and have these:
$ cat ~/bin/docker
#!/bin/bash
if [ "$DOCKER_HOST" != "" ]
then
HOST_ARG="-H $DOCKER_HOST"
fi
/usr/bin/docker $HOST_ARG $@
$ cat ~/bin/docker-compose
#!/bin/bash
if [ "$DOCKER_HOST" != "" ]
then
HOST_ARG="-H $DOCKER_HOST"
fi
/usr/local/bin/docker-compose $HOST_ARG $@