Container တွေကို run လုပ်ပြီးတဲ့နောက် stop, start, restart, remove လုပ်ရတာတွေရှိပါတယ်။ Local development မှာ container တွေကိုမရှင်းဘဲထားရင် port conflict, storage ပြည့်တာမျိုးတွေဖြစ်တတ်လို့ စီမံနည်းသိထားဖို့လိုပါတယ်။
dockerfile
# Stop a running container
docker stop web-demo
# Start an existing stopped container
docker start web-demo
# Restart a container
docker restart web-demo
# Remove a stopped container
docker rm web-demo
# Force remove a running container when needed
docker rm -f web-demostop က running container ကိုရပ်ပါတယ်။ start က ရှိပြီးသား stopped container ကိုပြန်စပါတယ်။ rm က container ကိုဖျက်ပါတယ်။ Running container ကိုဖျက်ချင်ရင် ပုံမှန်အားဖြင့် အရင် stop လုပ်သင့်ပါတယ်။
You should see
Command အောင်မြင်ပါက container name သို့မဟုတ် container ID ကို terminal မှာပြန်ပြပါမယ်။Info
docker rm က container ကိုဖျက်တာပါ။ Image ကိုဖျက်ချင်ရင် docker rmi ကိုသုံးရပါတယ်။