docker½øÈëÈÝÆ÷ÔõôÍ˳ö
Í˳ö docker ÈÝÆ÷µÄÒªÁ죺ÔËÐÐ docker stop ÏÂÁîÏò docker ÊØ»¤Àú³Ì·¢ËÍ×èÖ¹ÇëÇó¡£ÊØ»¤Àú³ÌÏòÈÝÆ÷·¢ËÍ sigterm ÐźÅÒÔ¿É¿ØÍ˳ö£¬ÈôÊÇ 10 ÃëÄÚδÍ˳ö£¬Ôò·¢ËÍ sigkill ÐźÅÇ¿ÖÆÍ˳ö¡£
Docker Í˳öÈÝÆ÷
ÔÚ Docker ÖÐÍ˳öÈÝÆ÷µÄÒªÁìºÜ¼òÆÓ£º
docker stop
µÇ¼ºó¸´ÖÆ
´ËÏÂÁÁ¬Ã¦×èÖ¹ÈÝÆ÷¡£
ÏêϸڹÊÍ£º
Docker ʹÓÃÒ»¸öÃûΪ Docker Engine µÄÊØ»¤Àú³ÌÀ´ÖÎÀíÈÝÆ÷¡£Òª×èÖ¹ÈÝÆ÷£¬ÄúÐèÒªÓë Docker Engine ¾ÙÐн»»¥¡£Ê¹Óà docker stop ÏÂÁî¿ÉÒÔÏòÊØ»¤Àú³Ì·¢ËÍ×èÖ¹ÈÝÆ÷µÄÇëÇó¡£
stop ÏÂÁî½ÓÊÜÒ»¸ö²ÎÊý£¬¼´Òª×èÖ¹µÄÈÝÆ÷µÄÃû³Æ»ò ID¡£¿ÉÒÔ´Ó docker ps ÏÂÁî»ñµÃÈÝÆ÷µÄÃû³Æ»ò ID¡£
ÀýÈ磬Ҫ×èÖ¹ÃûΪ “my-container” µÄÈÝÆ÷£¬Äú¿ÉÒÔÔËÐÐÒÔÏÂÏÂÁ
docker stop my-container
µÇ¼ºó¸´ÖÆ
ÈôÊÇÒª×èÖ¹ ID Ϊ “1234567890abcdef” µÄÈÝÆ÷£¬Äú¿ÉÒÔÔËÐÐÒÔÏÂÏÂÁ
docker stop 1234567890abcdef
µÇ¼ºó¸´ÖÆ
µ± docker stop ÏÂÁîÖ´ÐÐʱ£¬ÊØ»¤Àú³Ì½«ÏòÈÝÆ÷·¢ËÍ SIGTERM Ðźš£¸ÃÐźŸæËßÈÝÆ÷ÒԿɿصķ½·¨Í˳ö¡£ÈôÊÇÈÝÆ÷ÔÚ 10 ÃëÄÚδÍ˳ö£¬ÊØ»¤Àú³Ì½«Ôٴη¢ËÍ SIGKILL Ðźţ¬Õ⽫ǿÖÆÈÝÆ÷Í˳ö¡£
Í˳öÈÝÆ÷ºó£¬Äú¿ÉÒÔʹÓÃÒÔÏÂÏÂÁÆä´ÓϵͳÖÐɾ³ý£º
docker rm
µÇ¼ºó¸´ÖÆ
ÒÔÉϾÍÊÇdocker½øÈëÈÝÆ÷ÔõôÍ˳öµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡