Docker Lab-Day1

DevOps

MOTOSHARE 🚗🏍️
Turning Idle Vehicles into Shared Rides & Earnings

From Idle to Income. From Parked to Purpose.
Earn by Sharing, Ride by Renting.
Where Owners Earn, Riders Move.
Owners Earn. Riders Move. Motoshare Connects.

With Motoshare, every parked vehicle finds a purpose. Owners earn. Renters ride.
🚀 Everyone wins.

Start Your Journey with Motoshare

Difference between docker kill/stop

[root@ip-172-31-17-58 centos]# docker ps -a | grep aarushi
7190d7753cb1   httpd         "httpd-foreground"   3 minutes ago        Exited (0) 3 seconds ago                aarushi4
9a6ee8ab4226   httpd         "httpd-foreground"   9 minutes ago        Exited (137) 2 seconds ago              aarushi3Code language: PHP (php)

For docker kill – process exits with a bad status code – 137

For docker stop – process exits with a good status code – 0

That validates what is specified in the documentation that for docker kill – process is terminated unexpectedly whereas for docker stop – process is terminated abruptly.

Note for the containers above we had got the status codes post below commands

docker stop aarushi4 && docker kill aarushi3

Difference between docker pause/unpause

We can apply pause on a container in running state.

But can apply unpause – on a paused container

If we don’t we get error like –

[root@ip-172-31-17-58 centos]# docker unpause aarushi4
Error response from daemon: Container 7190d7753cb15424fa078fd4c1f45798ca380519819278ed7c596d3d404e1c3b is not pausedCode language: CSS (css)
[root@ip-172-31-17-58 centos]# docker pause liki
Error response from daemon: Container f22eaf3efd9a497e4ac104fcf8036cf9f4eeb94d783ae8b5f9599e5490d2ea9e is not runningCode language: CSS (css)