📅  最后修改于: 2023-12-03 14:40:49.581000             🧑  作者: Mango
To remove a Docker image by its ID, you can use the following command:
docker rmi <image-id>
Replace <image-id>
with the ID of the image you want to remove.
Open a command-line interface (CLI) or a Docker terminal.
List the Docker images present on your system:
docker images
This will display a list of Docker images along with their IDs, tags, and sizes.
Identify the ID of the image you want to remove from the list.
Execute the following command to remove the image using its ID:
docker rmi <image-id>
Replace <image-id>
with the actual ID of the image you want to remove.
For example:
docker rmi 8dfafdbc3a40
This command will remove the specified Docker image from your system.
Note: If the image is currently being used by a running container, you will need to stop and remove the container first before removing the image.
Verify that the image has been successfully removed:
docker images
The image should no longer appear in the list.
It is important to note that once you remove a Docker image, it cannot be recovered. Therefore, exercise caution when removing images as it will permanently delete them from your system.
Markdown标记:
docker rmi <image-id>
docker rmi <image-id>
docker rmi <image-id>