Showing posts with label docker. Show all posts
Showing posts with label docker. Show all posts

Wednesday, October 22, 2025

Script to stop all Containerlab and docker processes in a server

 Have you ever needed to stop all Containerlab in a server?


Is it complicated because there are so many users and so many Docker containers?


After rebooting, you still see running machines and different instances? This script is for you.


---- cut here ----

#filename: download-all-containerlab.sh

sudo containerlab destroy --all

sudo docker stop $(sudo docker ps -q --filter "label=containerlab")

sudo docker rm $(sudo docker ps -aq --filter "label=containerlab")

sudo ip link delete clab-bridge

sudo systemctl restart docker

---- cut here ----


Run: sudo bash download-all-containerlab.sh


Hopefully this is helpful