Docker Lab-Day1

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              aarushi3

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 paused
[root@ip-172-31-17-58 centos]# docker pause liki
Error response from daemon: Container f22eaf3efd9a497e4ac104fcf8036cf9f4eeb94d783ae8b5f9599e5490d2ea9e is not running