Check for docker support being installed

This commit is contained in:
Olivier 'reivilibre' 2020-12-31 20:50:15 +00:00
parent b36226573b
commit 6eb6b54f26

View File

@ -18,6 +18,11 @@ _docker_client_instance = None
def _docker_client():
if not docker:
# check docker is actually installed and give a message with the resolution
# when it isn't.
raise RuntimeError("You need to install docker from PyPI to use these utensils!")
global _docker_client_instance
if not _docker_client_instance:
_docker_client_instance = docker.from_env()