1
$\begingroup$

I've been trying to learn how to run some docker-dependent scripts in Mathematica.

Every time I try to run the script, I get the same error:

RunProcess::pnfd: Program docker not found.  Check Environment["PATH"].

When troubleshooting, I tried the simpler command

RunProcess[{"docker", "version"}]

which, using cmd, should yield a "valid" answer. However, I just get the same error. What am I doing wrong?

$\endgroup$
2
  • 1
    $\begingroup$ Does RunProcess[{"docker.exe", "version"}] work for you? RunProcess will search the path but it does not default the extension. $\endgroup$
    – WReach
    Mar 15, 2022 at 2:40
  • $\begingroup$ @WReach This most definitely works. I feel stupid for not testing that first, damm. Thank you kindly! $\endgroup$
    – miniplanck
    Mar 15, 2022 at 11:04

1 Answer 1

3
$\begingroup$

Thanks to @WReach, a solution has been found. Apparently, all that it takes is to specify the windows extension, ".exe". As such, his command

RunProcess[{"docker.exe","version"}]

yields the expected result

<|"ExitCode" -> 0, "StandardOutput" -> "Client:
 Cloud integration: v1.0.22
 Version:           20.10.12
 API version:       1.41
 Go version:        go1.16.12
 Git commit:        e91ed57
 Built:             Mon Dec 13 11:44:07 2021
 OS/Arch:           windows/amd64
 Context:           default
 Experimental:      true

Server: Docker Desktop 4.5.1 (74721)
 Engine:
  Version:          20.10.12
 API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.12
  Git commit:       459d0df
  Built:            Mon Dec 13 11:43:56 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 contained:
  Version:          1.4.12
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
", "StandardError" -> ""|>
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.