InterviewSolution
Saved Bookmarks
| 1. |
How do you prune data in a Docker? |
|
Answer» Docker provides a system prune command to remove stopped containers and dangling IMAGES.Dangling images are the ones which are not attached to any CONTAINER. Run the prune command as below: docker system prune WARNING! This will remove:
Are you SURE you want to CONTINUE? [y/N] There is also a better and controlled way of removing containers and images using the command: Step 1: Stop the containers docker stop <container_id>Step 2: Remove the stopped container docker rm container_id docker rm 6174664de09dStep 3: Remove the images, first stop the container using those images and then docker rmi <image_name>:[<tag>]--GIVE image name and tag docker rmi ubuntu:1.0--give the image id docker rmi 4431b2a715f3 |
|