Running Docker Commands from Within MATLAB

Hi All,

I have successfully installed Docker on my mac (10.12.3), and can utilize it just fine from within terminal. Unfortunately, I need to be able to run Docker commands from within MATLAB, or some other application that allows for automation of multiple commands. (even the built-in script editor would work). When I run “docker” in terminal, it gives me the whole big list of commands, but when I run it in MATLAB or elsewhere, I get “/bin/bash: docker: command not found.” Evidently other applications don’t know that Docker is running.

I’m using this as a tool to run a piece of software that can only be run in docker. (It’s for school). Any chance someone could help me out? I’m sure I’m missing something simple…

Thanks,
Ben

check where your docker is installed (which docker) and then try to add this directory to the PATH or to invoke it by the absolute path /usr/bin/docker

Hi think,

Hmmm. It’s installed in /usr/local/bin/docker. Do you think that’s a problem?

I added /usr/local/bin/to my path in MATLAB, and then /usr/bin/, but it didn’t fix anything. Still got the “/bin/bash: docker: command not found” error. Is that what you meant for me to do, or am I misunderstanding?

Thank you very much,
Ben

you also could try to invoke /usr/local/bin/docker instead of docker just to see if this satisfies your MATLAB. :slight_smile:

1 Like

Ah-ha! That worked. Thanks for saving the day.