I had read in the docker-py documentation that an SSH connection could be used, but couldn’t find an example for it.

Finally made it work this way :

import docker
client = docker.DockerClient(base_url='ssh://user@host')