Day-1: Q2. What is the difference between docker stop and docker kill?

DevOps

YOUR COSMETIC CARE STARTS HERE

Find the Best Cosmetic Hospitals

Trusted • Curated • Easy

Looking for the right place for a cosmetic procedure? Explore top cosmetic hospitals in one place and choose with confidence.

“Small steps lead to big changes — today is a perfect day to begin.”

Explore Cosmetic Hospitals Compare hospitals, services & options quickly.

✓ Shortlist providers • ✓ Review options • ✓ Take the next step with confidence

docker stop stops the container gracefully where as docker kill terminates the process immediately. docker stop showing status as “Exited (0)” and docker kill showing status as “Exited (137)”

root@ip-172-31-28-155:/home/ubuntu# docker start anoop2
anoop2
root@ip-172-31-28-155:/home/ubuntu# docker start anoop1
anoop1
root@ip-172-31-28-155:/home/ubuntu# docker ps -a | grep anoop
c5a741893181   httpd          "httpd-foreground"       4 minutes ago        Up 23 seconds                       80/tcp    anoop2
fc660bad9f21   httpd          "httpd-foreground"       4 minutes ago        Up 18 seconds           

root@ip-172-31-28-155:/home/ubuntu# docker stop anoop1
anoop1
root@ip-172-31-28-155:/home/ubuntu# docker kill anoop2
anoop2

root@ip-172-31-28-155:/home/ubuntu# docker ps -a | grep anoop
c5a741893181   httpd          "httpd-foreground"       4 minutes ago    Exited (137) 9 seconds ago              anoop2
fc660bad9f21   httpd          "httpd-foreground"       5 minutes ago    Exited (0) 12 seconds ago               anoop1Code language: PHP (php)