coltoneshaw / mmhealth

Mattermost Healthcheck tool
Other
2 stars 2 forks source link

Include a check for Docker on starting #16

Open jlandells opened 6 months ago

jlandells commented 6 months ago

Is your feature request related to a problem? Please describe. When running mmhealth, a running Docker platform is required (such as Docker Desktop). Without an appropriate Docker API version, the process fails, but the error message is not helpful:

docker: "specify container image platform" requires API version 1.41, but the Docker daemon API version is 1.24.
See 'docker run --help'.
Error: failed to generate the pdf report: failed to wait for the command to finish: exit status 125
Usage:
  mmhealth generate [flags]

Flags:
      --debug               Whether to show debug logs or not (default true)
  -h, --help                help for generate
  -o, --outputName string   the output file name for the PDF. (default "healthcheck-report")
  -p, --packet string       the support packet file to process
      --raw                 Skips the generation of a pdf file.

failed to generate the pdf report: failed to wait for the command to finish: exit status 125

Describe the solution you'd like Before starting the healthcheck process, it should be possible to perform a connection check to Docker, and if it fails, a more helpful message, such as Docker connection check failed. Is Docker currently available on this system? should be returned.

Describe alternatives you've considered As an alternative, this error condition could be simply noted in the README, to remind people to start Docker Desktop (or equivalent) before running the code.

Additional context Not everyone has Docker Desktop running all the time, as it can impact other software (such as VMware Workstation).

jlandells commented 6 months ago

To add to this, the error message displayed seems to suggest that Docker needs to be updated, rather than started, and even then, it's lost in the noise of the output. Looking at the end of the error block, the implication (to the user) is that they've somehow called mmhealth incorrectly.

coltoneshaw commented 6 months ago

I wonder why yours shows that, it should look like:

docker: Cannot connect to the Docker daemon at unix:///Users/coltonshaw/.docker/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.

I haven't added a docker check because I felt like that was enough. Let me look at what it would take to add a check