DEV Community

Cover image for 20 Docker commands use cases for developers

20 Docker commands use cases for developers

Alex Barashkov on January 24, 2019

Technology is most effective when you know how to work with it; bear this in mind when you work with Docker. Teams adopting Docker for the first ti...
Collapse
 
andre profile image
André König

Thanks for sharing this overview, Alex! :)

There is also docker system prune to remove all unused data (volumes, stopped containers, etc.).

Collapse
 
david_j_eddy profile image
David J Eddy

Bonus of 'docker prune': it does not remove running services & related images.

Collapse
 
cmtatro85 profile image
Christopher Tatro

This is almost true. Sometimes docker system prune will leave hanging and orphaned volumes. Specifically in the docker overlay dir.

Collapse
 
alex_barashkov profile image
Alex Barashkov

Thank you, added by your recommendation to the article :) Used many times but forgot to mention.

Collapse
 
clovis1122 profile image
José Clovis Ramírez de la Rosa

Good article, Alex!

This stops containers and removes each container’s networks, volumes, and images created by ip. This is helpful when you want to start from a clean slate.

I believe that docker-compose down doesn't remove the volume by default (unless you pass -v).

Collapse
 
labibllaca profile image
labibllaca

Great article, Alex. What about the mounting of volumes, is it frequently used in a daily basis, to be a part of the article ?

Cheers, Labi

Collapse
 
paritoshanand profile image
Paritosh

Great article, will be sharing this further with my team.

Is there any way in prune via which I can remove unused volumes from the base machine ?

Collapse
 
rahultechno profile image
rahultechno

Amazing knowledge share. Alex Barashkov.

Collapse
 
kgoutham93 profile image
Goutham Kolluru

Hi Alex, nice article. Correct me if I'm wrong but I think --no-cache will still pick cached base image.

Collapse
 
rierjarv profile image
Riku Järvinen

Great article, thanks! I'm learning docker and this goes to my reference link list.

Collapse
 
juniorvla profile image
Arnaldo Junior

Thanks for sharing it.

Well.. docker system is a cache?

Collapse
 
migueloop profile image
Miguel Ruiz

Nice to have, thanks!