更改文件夹名称

This commit is contained in:
2025-10-31 15:19:17 +08:00
parent 0a4143bd7c
commit d1b2aef9c7
31 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
# Docker容器和镜像的删除操作
## 容器和镜像的关系
简单来说,镜像是文件,容器是进程。
容器是基于镜像创建的,即容器中的进程依赖于镜像中的文件。
docker利用容器来运行应用docker容器是由docker镜像创建的运行实例。
![容器与镜像](https://i-blog.csdnimg.cn/blog_migrate/1239ccc5a805c44d9ecb6bc844ac9457.jpeg)
### 删除镜像的操作步骤
#### 一、停止正在运行的镜像创建的容器
查看正在运行的容器
```shell
docker ps
```
停止对应容器
```shell
docker stop xxx
```
xxx 是 docker ps 命令出来的容器 CONTAINER ID 的前三位
删除对应的容器
```shell
docker rm xxx
```
查看镜像
```shell
docker images
```
同理yyy 是 docker images 命令出来的镜像 IMAGE ID 的前三位
删除对应的镜像
```shell
docker rmi yyy
```