Some Useful Docker Commands

Five years ago I wrote the post Git: some useful commands (in Russian). Probably, it’s a good idea to translate it into English too but it’s a different story.

I used that post as a handbook for some git commands which I had to use really rare. Now I would like to create a similar list for Docker. Some of these commands you can easily find in the manual and help but if you’re such lazy as me, you would like to get such list noted somewhere.

List all running containers of docker compose.

Really, I forget about this too often and use docker ps. I have to use docker-compose ps for these needs.

Fast validation of the docker-compose.yaml

It’s just docker-compose config

Remove all existing docker containers

A bit of bash is here: docker rm $(docker ps -a -q)

Remove all existing images

It’s very similar to the previous one: docker rmi $(docker images -a -q)

Remove all existing non-used volumes:

I use -f flag, do not ask for the confirmation docker volume prune -f

Remove everything

I use -f flag, do not ask for the confirmation docker system prune -a -f

Stop all running containers

Kill ‘Em All: docker kill $(docker ps -q)

I’ve got aliases for most of these command in my ‘bashrc’ file now, so I don’t need to remember any of them now :).

Tags

.net .net-framework .net-framework-3.5 agile ajax ajax-control-toolkit ampq ansible apache asp.net asp.net-mvc axum bash benchmark blog blog-engine bootstrap buildout c# cache centos chrome ci cinder ckan cli cloud codeplex community debugger deface development-environment devstack devtime django dlr dns docker dockerimage dos easy_install elmah encoding environment-variables error event events exception exceptions fabrik firefox foreach forms gae gcc git github go google google-app-engine hack hacked hardware headless horizon html hugo iaas ienumerable iis internet iptables iron-python ironic iscsi java-script javascript jenkins jquery js kharkivpy kombu kvm kyiv lettuce libvirt linux lio loci logging mac-os mercurial microsoft microsoft-sync-framework mobile mono ms-office msbuild networking news nginx offtopic open-xml opensource openstack openvswitch os packages paraller-development patterns--practices php pika pip pnp podcast popup postgresql profiler project protocols pycamp pycharm pycon pykyiv pylint pypi python python-3 qcow quantum qumy rabbitmq rar react refactoring rfc rhel search-engine security selenium server shell silverlight socket source-control sourcegear-vault sql sql-server sql-server-express sqlalchemy ssh svg tests tgt tipfy tornado typescript uapycon ui uneta unit-tests usability virtualenv visual-studio vm vue.js vuejs web-development web-server web-service webpack windows windows-live word-press x32 x64 xcode xml xss xvfb интернет-магазин книги

Recent posts

Docker Image Collection

Not a DNS Server for Libvirt

Diskimage-builder in Docker

Everything as a Code

Vue.js, global variables and TypeScript


Archives

2019 (19)
2018 (2)
2017 (3)
2016 (2)
2015 (3)
2014 (5)
2013 (17)
2012 (22)
2011 (35)
2010 (25)
2009 (35)
2008 (32)
2007 (2)