Docker Practice Notes

This post is about: How to remove docker images, run docker images and compose docker-compose file.

Delete Docker images:


To delete all containers including its volumes use,

 docker rm -vf $(docker ps -a -q) 

To delete all the images,

 docker rmi -f $(docker images -a -q) 

Remember, you should remove all the containers before removing all the images from which those containers were created.


get into docker bash:

you have to run entrypoint before image:

 docker run -it --entrypoint /bin/bash <image> 

get docker container id within the current container

Use the following command to find out the container id:

 head -1 /proc/self/cgroup|cut -d/ -f3 
Written on June 30, 2018