dockerÈÝÆ÷Ãû³ÆÔõô²é
¿ÉÒÔͨ¹ýÒÔÏ°취ÅÌÎÊ docker ÈÝÆ÷Ãû³Æ£ºÁгöËùÓÐÈÝÆ÷£¨docker ps£©¡£É¸Ñ¡ÈÝÆ÷ÁÐ±í£¨Ê¹Óà grep ÏÂÁ¡£»ñÈ¡ÈÝÆ÷Ãû³Æ£¨Î»ÓÚ “names” ÁÐÖУ©¡£
ÔõÑùÅÌÎÊ Docker ÈÝÆ÷Ãû³Æ
Òª²éÕÒ Docker ÈÝÆ÷µÄÃû³Æ£¬¿ÉÒÔʹÓÃÒÔÏ°취£º
1. ÁгöËùÓÐÈÝÆ÷
docker ps
µÇ¼ºó¸´ÖÆ
2. ɸѡÈÝÆ÷Áбí
ҪɸѡֻÓÐÌØÃüÃû³ÆµÄÈÝÆ÷£¬¿ÉÒÔʹÓà grep ÏÂÁ
docker ps | grep
µÇ¼ºó¸´ÖÆ
ÀýÈ磬Ҫ²éÕÒÃû³ÆΪ “web” µÄÈÝÆ÷£¬¿ÉÒÔÔËÐÐÒÔÏÂÏÂÁ
docker ps | grep web
µÇ¼ºó¸´ÖÆ
3. »ñÈ¡ÈÝÆ÷Ãû³Æ
docker ps ÏÂÁîÊä³ö½«ÏÔʾÓйØÿ¸öÈÝÆ÷µÄÐÅÏ¢£¬°üÀ¨ÆäÃû³Æ¡£¸ÃÃû³Æͨ³£ÔÚ “NAMES” ÁÐÖС£
ʾÀýÊä³ö£º
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 987654321011 nginx "/docker-entrypoint" 3 minutes ago Up 3 minutes 80/tcp web
µÇ¼ºó¸´ÖÆ
ÔÚÉÏÃæµÄʾÀýÖУ¬ÈÝÆ÷µÄÃû³ÆΪ “web”¡£
ÒÔÉϾÍÊÇdockerÈÝÆ÷Ãû³ÆÔõô²éµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡
ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿Ê±ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿Ê±ÊµÊ±ÐÞÕý»òɾ³ý¡£