Clean docker

joel
1 min readOct 10, 2019

--

Sometime when we upgrade docker from a lower version to higher or any other situation, we might see some images by “docker images”, but while we run “docker image rm xxx”, it says no such image.

This means that the docker state is corrupted and we need clear the complete state.

In this case, we might clean the folder “/var/lib/docker”. We could issue the following command to rebuild a clean docker environment.

sudo service docker stop
sudo rm -rf /var/lib/docker
sudo service docker start

Note, all the images, containers and volumes will be cleaned, it go back to the state you just installed docker. Think it twice before you do this.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response