lucj/sophia.events

bin/ scripts - check docker availability and graceful fail

hervenicol opened this issue · 2 comments

If docker is not up on your machine, or not available for the current user, the error is not properly caught and the script is not able to generate a meaningful error message.

Example:

$ ./1-build.sh 
ERRO[0000] failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial unix /var/run/docker.sock: connect: no such file or directory 
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
must specify at least one container source
must specify at least one container source
"docker inspect" requires at least 1 argument.
See 'docker inspect --help'.

Usage:  docker inspect [OPTIONS] NAME|ID [NAME|ID...] [flags]

Return low-level information on Docker objects
=> web site available on http://localhost:
$
lucj commented

Good catch, thanks. Can I expect a PR then ? :)