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
495926dadc37   bridge    bridge    local
9ccc3f610ba3   host      host      local
fb07f9529ad6   none      null      local
c11905d53e0c   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
495926dadc37   bridge    bridge    local
9ccc3f610ba3   host      host      local
fb07f9529ad6   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