What to do when Centos 7 runs out of space on /

I recently ran into the problem of Centos 7 running out of space on / and when I restarted the machine it was unable to boot into the gui because it ran out of hard drive space. I was also not able to boot into emergency mode systemd.unit=emergency.target or rescue mode systemd.unit=rescue.target because / was just out of space.

How I solved this problem was to boot into the main image and pressed Esc on the keyboard to watch the boot process happening. I saw that SSH was able to start up and the network was able to be established. I SSH into the box and ran sudo du -h –max-depth=1 on / to see where all the space was taken up. After some searching I was able to locate /var/lib/docker that was using up the entire space allocated to /. The space was taken up in the /containers and the /volumes folders. I ran rm /var/lib/docker/container/* and rm /var/lib/docker/volumes/* This freed up almost all the space on /. I rebooted and Centos 7 came up as expected.