mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-22 23:04:21 +00:00
✨ Add an error message if the connection to the Docker daemon fails
This commit is contained in:
parent
eb3cf89a99
commit
178a99c23f
1 changed files with 8 additions and 2 deletions
|
@ -2,12 +2,18 @@ import enum
|
|||
import logging
|
||||
import time
|
||||
|
||||
import docker.errors
|
||||
import docker.models.containers
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
log.info("Connecting to Docker daemon...")
|
||||
try:
|
||||
client: docker.DockerClient = docker.from_env()
|
||||
except docker.errors.DockerException as e:
|
||||
log.fatal("Could not connect to the Docker daemon!")
|
||||
raise
|
||||
else:
|
||||
log.info("Connection to Docker daemon successful!")
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue