Suggest an editImprove this articleRefine the answer for “How do you remove a Docker image?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)Removal is done using the **`docker rmi`** command. **Key point:** as long as a container is created or running from an image, the image cannot be removed.Shown above the full answer for quick recall.Answer (EN)ImageRemoval is done using the `docker rmi` command. ### **1. View images** ```bash docker images ``` ### **2. Remove a specific image** ```bash docker rmi IMAGE_NAME ``` or by ID: ```bash docker rmi IMAGE_ID ``` ### **3. If the image is used by a container** First remove the container: ```bash docker rm CONTAINER_ID ``` And then again: ```bash docker rmi IMAGE_ID ``` ### **4. Remove all unused images** ```bash docker image prune ``` or, radically (everything unused): ```bash docker system prune -a ``` **Main rule:** as long as a container is created or running from an image, the image cannot be removed.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.