Search code examples
macosdockerterminalinstallationcntk

How to run a library in docker - confusion


I am trying to use microsoft's cntk library on a mac; for this purpose I am using Docker. I am not an expert in all this, though, so I am having a hard time figuring out how to make it work.

From my understanding, Docker provides a way to run an app in a virtualized environment, without having to virtualize the entire operating system. So you download (or create) images, and you run them in "containers".

Alright, so I have followed the required steps to make the cntk library work on Docker; and if I list the images, I find

$: docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
microsoft/cntk      latest              c2c192036e19        7 days ago          5.92 GB
ubuntu              14.04               7c09e61e9035        5 weeks ago         188 MB
hello-world         latest              48b5124b2768        2 months ago        1.84 kB

At this point I want to run of the tutorials that are in the cntk repository. I have downloaded the master branch of the cntk repository on my desktop and try to run one of the examples in the "Tutorial" folder, but I get the following error:

terminal~ username$  docker run -w /Users/username/Desktop/CNTK-master/Tutorials microsoft/cntk configFile=lr_bs.cntk
container_linux.go:247: starting container process caused "exec: \"configFile=lr_bs.cntk\": executable file not found in $PATH"
docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"configFile=lr_bs.cntk\": executable file not found in $PATH".
ERRO[0001] error getting events from daemon: net/http: request canceled 
terminal~ username$ 

Essentially I call docker run with the -w flag to inform him of where the files are, but it does not work. I tried searching online but it's not clear to me how to solve the issue. Should I create a new image? Should I call the docker run command with different parameters?


Solution

  • The -w flag sets the working directory, which is just the default directory inside the container. Your directory is on the host, so it won't work here. Instead you need to use volumes to mount your directory on the host into the container. The final paragraph in the document you link has an example:

    $ docker run --name cntk_container1 -ti -v /project1/data:/data -v /project1/config:/config cntk bash