I run a docker which starte a python script. This python scripts needs certain paths. But something with the paths must be wrong.
I know that I can have a look into the created docker with: sudo docker run -it neurolab/abnormalityindex:1.1 /bin/bash
but not when I mount with -v.
So how can I see in the docker container when I run it which files are inlcuded when using -v. Something like: ls -R /data
I’m not sure why it would not work in combination with -v. (I’d guess it’s because you actually already run another command, some specific Python script, in the 2nd example, which you’re not doing in the first? So, it’s unrelated to using -v then.)
However, you don’t need to set it up when starting the container. Instead, start it as usual, and then use another docker exec to get to the running container. Something like:
Are you sure the new command is not giving you errors? I see curly quotes in the last -v line. Also, it seems the 3rd and 6th lines are missing the trailing \ to concatenate the lines? And one line uses Deskto rather than Desktop. So, is this the exact command you ran?
Aside:
As you did not specify --name some-name in the 2nd example in your first post, Docker will assign a random name, which you should be able to see when using docker ps. But of course the command from your last post should do to investigate as well.
You don’t need to do that to fix your problem. But I was responding to your “With your suggested command it does not find the container”, whatever that means exactly. If you want to use, say, docker exec -it my-container-name /bin/bash to connect to a running container named “my-container-name”, then you’ll need to use --name my-container-name in the docker run command that you use to start your application. If you do not use --name then just type docker ps in another command prompt to see the list of generated names, and use that name in the docker exec command. (The Docker Desktop GUI will show the name as well, and when hovering a running container’s name it will even offer a “CLI” option to open a prompt in that running container.)
As far as I can see, your command should work (even despite the trailing / in /Stephan/Programmes/freesurfer/license.txt/). I’d try with one line of -v ... at a time and see when things no longer work.
The following debugging with busybox works for me, on a Mac running Linux containers:
(Scroll above code block to see all. And yes, mapping the same source to both /data and /data/sub-1 yields confusing output of the ls /data/sub-1 command.)
So I guess we’ll need to know more about the neurolab/abnormalityindex:1.1 image you’re using, and about the exact results for your ls commands.