×ðÁú¿­Ê±¹ÙÍøµÇ¼

dockerÔõô²éÕÒÈÝÆ÷

Äú¿ÉÒÔʹÓà docker ÌṩµÄ¶àÖÖÒªÁì²éÕÒÈÝÆ÷ £¬°üÀ¨£ºdocker cli£ºÊ¹ÓÃÏÂÁîÈç docker ps ÁгöÈÝÆ÷ £¬²¢Ê¹ÓùýÂËÆ÷ËõСËÑË÷¹æÄ£¡£docker api£º·¢ËÍÇëÇóÒÔ¼ìË÷ÈÝÆ÷ÐÅÏ¢¡£docker compose£ºÊ¹ÓÃÏÂÁîÈç docker-compose ps ÁгöÈÝÆ÷¡£docker ¹¤¾ß£ºÊ¹Óà docker explorer »ò portainer µÈ¹¤¾ßÔÚͼÐνçÃæÖÐÖÎÀíÈÝÆ÷¡£ÈÝÆ÷ id£ºÊ¹ÓÃΨһ id Óë docker cli¡¢api »ò¹¤¾ßÒ»Æð²éÕÒÈÝÆ÷¡£

ÔõÑù²éÕÒ Docker ÈÝÆ÷

Docker ÌṩÁ˶àÖÖÒªÁìÀ´²éÕÒºÍɸѡÈÝÆ÷¡£ÒÔÏÂÊǼ¸ÖÖ³£ÓõÄÒªÁ죺

1. ʹÓà Docker CLI ²éÕÒÈÝÆ÷

# ÁгöËùÓÐÈÝÆ÷
docker ps

# ¹ýÂËÈÝÆ÷Áбí
docker ps -a # ÁгöËùÓÐÈÝÆ÷£¬°üÀ¨ÒÑ×èÖ¹µÄÈÝÆ÷
docker ps --filter "name=my-container" # ¹ýÂËÃû³ÆΪ "my-container" µÄÈÝÆ÷

µÇ¼ºó¸´ÖÆ

2. ʹÓà Docker API ²éÕÒÈÝÆ÷

# ʹÓà curl ·¢ËÍÇëÇó
curl -X GET -H "Content-Type: application/json" http://localhost:2375/containers/json

µÇ¼ºó¸´ÖÆ

3. ʹÓà Docker Compose ²éÕÒÈÝÆ÷

# ÁгöËùÓÐÈÝÆ÷
docker-compose ps

# ¹ýÂËÈÝÆ÷Áбí
docker-compose ps --filter "name=my-container" # ¹ýÂËÃû³ÆΪ "my-container" µÄÈÝÆ÷

µÇ¼ºó¸´ÖÆ

4. ʹÓà Docker ¹¤¾ß²éÕÒÈÝÆ÷

Docker Explorer£ºÒ»¸öͼÐνçÃæ £¬ÔÊÐíÄúä¯ÀÀºÍÖÎÀí Docker ÈÝÆ÷¡£

Portainer£ºÒ»¸ö¿ªÔ´ÈÝÆ÷ÖÎÀíƽ̨ £¬Ìṩһ¸öͼÐνçÃæÀ´ÖÎÀíÈÝÆ÷¡£

5. ʹÓà Docker ÈÝÆ÷ ID ²éÕÒÈÝÆ÷

ÿ¸öÈÝÆ÷¶¼·ÖÅÉÁËÒ»¸öΨһµÄ ID¡£Äú¿ÉÒÔʹÓÃ´Ë ID Óë Docker CLI¡¢API »ò¹¤¾ßÒ»Æð²éÕÒÈÝÆ÷¡£

# ʹÓà Docker CLI
docker inspect <container-id></container-id>

µÇ¼ºó¸´ÖÆ

ÌáÐÑ£º

ʹÓà -f »ò –filter Ñ¡Ïî¹ýÂËÈÝÆ÷Áбí £¬ÒÔËõСËÑË÷¹æÄ£¡£

Äú»¹¿ÉÒÔʹÓà docker inspect ÏÂÁîÀ´Éó²éÓйØÌض¨ÈÝÆ÷µÄÏêϸÐÅÏ¢ £¬°üÀ¨Æä ID¡¢Ãû³Æ¡¢Í¼ÏñºÍÆäËûÔªÊý¾Ý¡£

ÒÔÉϾÍÊÇdockerÔõô²éÕÒÈÝÆ÷µÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ