[HOWTO] Some useful Docker commands

Once you have mastered the art of building your custom /e/ ROM’s using Docker method as mentioned here your hard disk gets full of containers and images. Here are a collection of commands that you may find useful to clean up your hard disk and retrieve some space. These commands are executed in a konsole.

  • Docker Stop all containers
    docker stop $(docker ps -aq)

  • Delete all containers
    docker rm $(docker ps -a -q)

  • Delete all images
    docker rmi $(docker images -q)

  • Show all images
    docker image ls

  • Remove image by id …here we will use an example of an id which you retrieved using the previous command
    docker rmi 75f08d5b848d

1 Like

Thx Manoj,

could you pls add that root (sudo) is to use for them ?

And how to edit a docker image ?

I do not run these command with sudo as my user is added to the docker group . For that you run this command where your-user will be replaced with your username

sudo usermod -aG docker your-user

1 Like