docker rm -f $(docker ps -qa)
sudo reboot
sudo rm -rf /var/lib/rancher/state

Refarence

After remove a host from rancher, how to clean agent containers and iptable rules? - Rancher - Rancher Forums