Docker Community Forums

Share and learn in the Docker community.

A Mounting Issue

I use Ubuntu 18.04. I have a Docker container w2l:

~$ sudo docker ps -a
CONTAINER ID        IMAGE                               COMMAND                  CREATED             STATUS                     PORTS               NAMES
6a9a53d4a8cf        wav2letter/wav2letter:cuda-latest   "/bin/bash"              20 hours ago        Exited (0) 20 hours ago                        quizzical_hodgkin
3eaa8730871c        wav2letter/wav2letter:cuda-latest   "/bin/bash"              21 hours ago        Exited (0) 21 hours ago                        strange_nobel
a9edc077dd4a        wav2letter/wav2letter:cuda-latest   "/bin/bash"              36 hours ago        Exited (0) 36 hours ago                        beautiful_meitner
6362467aff39        wav2letter/wav2letter:cuda-latest   "/bin/bash"              2 days ago          Exited (0) 2 days ago                          affectionate_ganguly
9142523d810c        wav2letter/wav2letter:cuda-latest   "/bin/bash"              2 days ago          Exited (0) 2 days ago                          zen_wright
fb4270322d7d        wav2letter/wav2letter:cuda-latest   "/bin/bash"              2 days ago          Up 2 days                                      w2l
b61ccc4fdde9        32e2daa61913                        "sleep 60"               2 days ago          Exited (0) 2 days ago                          8258cb653044
2efc1847b062        hello-world                         "/hello"                 2 days ago          Exited (0) 2 days ago                          happy_boyd
8258cb653044        32e2daa61913                        "/bin/sh -c 'cd /roo…"   7 days ago          Exited (1) 7 days ago                          eager_carson
29192d48d01c        hello-world                         "/hello"                 10 days ago         Exited (0) 10 days ago                         brave_kepler
f525574be4c5        prakhar1989/static-site             "./wrapper.sh"           13 days ago         Exited (0) 13 days ago                         hardcore_antonelli
efe1c6f56dbd        prakhar1989/static-site             "./wrapper.sh"           13 days ago         Exited (0) 13 days ago                         ecstatic_taussig
6af9262ce472        prakhar1989/static-site             "./wrapper.sh"           13 days ago         Exited (0) 13 days ago                         static-site
9a58828c22ac        busybox                             "sh"                     13 days ago         Exited (0) 13 days ago                         kind_shirley
b20670111cc6        busybox                             "echo 'hello from bu…"   13 days ago         Exited (0) 13 days ago                         friendly_tu
88c14e699d5b        busybox                             "sh"                     13 days ago         Exited (0) 13 days ago                         pensive_chatelet
accae33e9c0f        hello-world                         "/hello"                 13 days ago         Exited (0) 13 days ago                         hopeful_hellman
c9b5a526389c        4288c3324aad                        "/bin/sh -c 'cd /roo…"   2 weeks ago         Exited (128) 2 weeks ago                       dazzling_bartik
baffbec352ee        nvidia/cuda:10.0-base               "nvidia-smi"             2 weeks ago         Exited (0) 2 weeks ago                         relaxed_tharp
6ce7f214d649        nvidia/cuda:10.0-base               "nvidia-smi"             2 weeks ago         Exited (0) 2 weeks ago                         dazzling_mahavira
2ac3dd36fe8d        nvidia/cuda:10.0-base               "nvidia-smi"             2 weeks ago         Exited (0) 2 weeks ago                         stoic_proskuriakova
334d4687aafe        nvidia/cuda:10.0-base               "nvidia-smi"             2 weeks ago         Created                                        great_shannon
7fa9f580afec        nvidia/cuda:10.0-base               "nvidia-smi"             2 weeks ago         Created                                        funny_pare
e00854feaab7        nvidia/cuda:10.0-base               "nvidia-smi"             2 weeks ago         Created                                        vibrant_heyrovsky
93079cb54c73        nvidia/cuda:10.0-base               "nvidia-smi"             3 weeks ago         Exited (0) 3 weeks ago                         relaxed_brahmagupta
c33070aec4ae        nvidia/cuda:10.0-base               "nvidia-smi"             3 weeks ago         Created                                        epic_hodgkin
f07ca2738f79        nvidia/cuda:10.0-base               "nvidia-smi"             3 weeks ago         Created                                        distracted_yalow
d34e9e8a8015        nvidia/cuda:10.0-base               "nvidia-smi"             3 weeks ago         Created                                        cranky_swanson
63cfb60b66b0        nvidia/cuda:10.0-base               "nvidia-smi"             3 weeks ago         Exited (0) 3 weeks ago                         intelligent_engelbart
edfd608d0225        nvidia/cuda:10.0-base               "nvidia-smi"             3 weeks ago         Created                                        pedantic_sammet
1b6f8e233246        nvidia/cuda:10.0-base               "nvidia-smi"             3 weeks ago         Exited (0) 3 weeks ago                         elegant_liskov
468ef9c5ba7b        nvidia/cuda:10.0-base               "nvidia-smi"             3 weeks ago         Created                                        practical_lichterman
580567a2b834        nvidia/cuda:10.0-base               "nvidia-smi"             3 weeks ago         Created                                        wizardly_wilson
918995b76b6a        nvidia/cuda:10.0-base               "nvidia-smi"             3 weeks ago         Created                                        gifted_euclid
23f6e3037e54        hello-world                         "/hello"                 3 weeks ago         Exited (0) 13 days ago                         reverent_sinoussi

In order to access the files in the folder,

/home/ml/w2l
:

from the container, I did:

$ sudo docker run -v /home/ml/w2l:/root/w2l wav2letter/wav2letter:cuda-latest

to mount

/home/ml/w2l
to
/root/w2l

The above command went through but it did not produce any messages.

Unfortunately, from the container, it sounds that I could not access the files in

/home/ml/w2l
:
root@fb4270322d7d:/# ls -lah /root/w2l
ls: cannot access '/root/w2l': No such file or directory
root@fb4270322d7d:/# cat /root/w2l/am/tokens.txt
cat: /root/w2l/am/tokens.txt: No such file or directory
root@fb4270322d7d:/# ls -l
total 76
drwxr-xr-x   1 root root 4096 Mar 31 23:35 bin
drwxr-xr-x   2 root root 4096 Apr 24  2018 boot
drwxr-xr-x   5 root root  440 May 25 22:02 dev
drwxr-xr-x   1 root root 4096 May 25 22:02 etc
drwxr-xr-x   2 root root 4096 Apr 24  2018 home
drwxr-xr-x   1 root root 4096 Nov 27 20:03 lib
drwxr-xr-x   2 root root 4096 Oct 29  2019 lib64
drwxr-xr-x   2 root root 4096 Oct 29  2019 media
drwxr-xr-x   2 root root 4096 Oct 29  2019 mnt
drwxr-xr-x   1 root root 4096 Mar 31 23:40 opt
dr-xr-xr-x 334 root root    0 May 25 22:02 proc
drwx------   1 root root 4096 May 26 02:02 root
drwxr-xr-x   1 root root 4096 May 25 22:02 run
drwxr-xr-x   1 root root 4096 Oct 31  2019 sbin
drwxr-xr-x   2 root root 4096 Oct 29  2019 srv
dr-xr-xr-x  13 root root    0 May 25 22:02 sys
drwxrwxrwt   1 root root 4096 May 27 09:46 tmp
drwxr-xr-x   1 root root 4096 Oct 29  2019 usr
drwxr-xr-x   1 root root 4096 Oct 29  2019 var

Any comments about this? Thank you!

Now, it sounds that the container is gone:

$ sudo docker exec -it w2l bash
Error: No such container: w2l

When I do:

$ sudo docker ps -a

the container, w2l, is not on the list anymore. I did not remove it. Anyway to have it back? In the future, how may I prevent this happen again? Thank you!