Skip to content

Commit f2171c4

Browse files
committed
Using Prune to Keep Your Docker System Clean added
1 parent 74f8941 commit f2171c4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docker-process-approach/docker-2.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,4 +239,17 @@ docker image rm codersh/testing-node
239239
docker container run --rm -p 80:3000 codersh/testing-node
240240
```
241241

242+
### Using Prune to Keep Your Docker System Clean:
243+
You can use "prune" commands to clean up images, volumes, build cache, and containers. Examples include:
244+
```
245+
docker image prune to clean up just "dangling" images
246+
247+
docker system prune will clean up everything
248+
```
249+
* The big one is usually ```docker image prune -a ``` which will remove all images you're not using. Use docker system df to see space usage.
242250

251+
```
252+
Remember each one of those commands has options you can learn with --help.
253+
Here's a YouTube video I made about it: https://youtu.be/_4QzP7uwtvI
254+
Lastly, realize that if you're using Docker Toolbox, the Linux VM won't auto-shrink. You'll need to delete it and re-create (make sure anything in docker containers or volumes are backed up). You can recreate the toolbox default VM with docker-machine rm default and then docker-machine create
255+
```

0 commit comments

Comments
 (0)