我是Docker的新手,我真的不知道我是否做对了。
我在Docker容器上有一个要删除的文件夹。我正在这样做:
sudo docker container ls -a
>> CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
48f7bbc9416e mabsed_kibana "/usr/local/bin/kiba…" About a minute ago Exited (0) 11 seconds ago mabsed_kibana_1
00dd32f78802 mabsed_dashboard "/usr/src/app/init.sh" About a minute ago Exited (1) About a minute ago mabsed_dashboard_1
c3e388ef3dad docker.elastic.co/elasticsearch/elasticsearch:6.7.0 "/usr/local/bin/dock…" About a minute ago Exited (143) 10 seconds ago mabsed_elasticsearch_1
sudo docker run -t mabsed_dashboard rm -r /usr/src/app/bower_components
>> (No output)
sudo docker run -t mabsed_dashboard ls -l /usr/src/app
>> total 64
-rw-rw-r-- 1 root root 633 Apr 15 12:22 Dockerfile
-rw-rw-r-- 1 root root 1676 Apr 14 11:43 bower.json
drwxr-xr-x 58 root root 4096 Apr 15 12:37 bower_components
-rw-rw-r-- 1 root root 4278 Feb 18 10:41 demo-dashboard.css
-rw-rw-r-- 1 root root 8958 Apr 15 12:33 demo-dashboard.html
drwxrwxr-x 6 root root 4096 Apr 12 11:14 elements
drwxrwxr-x 2 root root 4096 Apr 14 12:28 img
-rw-rw-r-- 1 root root 227 Apr 14 11:43 imports.html
-rw-rw-r-- 1 root root 2232 Apr 14 12:07 index.html
-rwxr-xr-x 1 root root 562 Feb 18 10:41 init.sh
drwxrwxr-x 2 root root 4096 Feb 18 10:41 k8s
-rw-rw-r-- 1 root root 1302 Feb 18 10:41 lab.cluster.gsi.dit.upm.es.crt
lrwxrwxrwx 1 root root 13 Apr 15 12:04 node -> /usr/bin/node
drwxrwxr-x 2 root root 4096 Feb 18 10:41 styles
如您所见,由于bower_components目录仍然存在,因此rm -r
命令似乎无效。知道我想念什么吗?