2024-03-03 09:29AM
1. 先使用 $ docker ps 或者 $ docker ps -a 命令来查看你要删除的 docker 容器 ID
meiyi@meiyi-Extensa-2511G:~/Downloads$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f6a76c36d4eb postgres "docker-entrypoint.s…" About a minute ago Created my-postgres
c9a07226ef7f postgres "docker-entrypoint.s…" 39 hours ago Exited (0) 16 hours ago agitated_murdock
d84c0c2bfab1 secfa/awvs "/bin/sh /awvs_start…" 3 months ago Exited (143) 2 months ago my-awvs
2d277c2c557e vulnerables/web-dvwa "/main.sh" 3 months ago Exited (137) 2 months ago competent_wiles
a3fdfbe3f7d1 hello-world "/hello" 3 months ago Exited (0) 3 months ago sad_noether
2. 使用 $ sudo docker rm <container_id_or_name> 来删除指定容器
将"<container_id_or_name>"替换为要删除的容器的ID或名称
meiyi@meiyi-Extensa-2511G:~/Downloads$ sudo docker rm f6a76c36d4eb
f6a76c36d4eb
3. 使用 $ docker ps 或者 $ docker ps -a 命令来查看是否删除成功
meiyi@meiyi-Extensa-2511G:~/Downloads$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c9a07226ef7f postgres "docker-entrypoint.s…" 39 hours ago Up About a minute 5432/tcp agitated_murdock
d84c0c2bfab1 secfa/awvs "/bin/sh /awvs_start…" 3 months ago Exited (143) 2 months ago my-awvs
2d277c2c557e vulnerables/web-dvwa "/main.sh" 3 months ago Exited (137) 2 months ago competent_wiles
a3fdfbe3f7d1 hello-world "/hello" 3 months ago Exited (0) 3 months ago sad_noether
登录
请登录后再发表评论。
评论列表:
目前还没有人发表评论