def docker_accessible():
 try:
  client = DockerClient()
  client._client.ping()
 except Exception as e:
  return str(e)
 return None

def docker_accessible ( ) : try : client = DockerClient ( ) client . _client . ping ( ) except Exception as e : return str ( e ) return None
attempt to connect to the docker control socket .