Clean up

Exercise - Clean up

You will not need the running containers after this, so clean up the environment before proceeding:

To stop all running containers execute:

docker ps -q | xargs docker stop

To remove all containers run:

docker ps -a -q | xargs docker rm

The network we created also still exists:

docker network ls

NETWORK ID     NAME      DRIVER    SCOPE
10b9448cc71d   bridge    bridge    local
2d2089ec09bd   host      host      local
81e8bb2089d0   none      null      local
3ba6a91f405b   todonet   bridge    local

To remove the network use:

docker network rm todonet

Check again to see that the network is gone:

docker network ls

NETWORK ID     NAME      DRIVER    SCOPE
10b9448cc71d   bridge    bridge    local
2d2089ec09bd   host      host      local
81e8bb2089d0   none      null      local

We also want to delete any volumes that we have created. For this, list the currently existing volumes via

docker volume list

You should see the entry for the postgresql volume we had created in the volumes chapter. Go ahead and delete it:

docker volume rm postgres_data

Milestone: DOCKER/CLEANUP