dockerÔõôÖØÆô
ÖØÆô docker ÈÝÆ÷µÄÒªÁ죺»ñÈ¡ÈÝÆ÷ id£¨docker ps£©£»×èÖ¹ÈÝÆ÷£¨docker stop £©£»Æô¶¯ÈÝÆ÷£¨docker start £©£»ÑéÖ¤ÖØÆôÀֳɣ¨docker ps£©¡£ÆäËûÒªÁ죺docker compose£¨docker-compose restart£©»ò docker api£¨²Î¿¼ docker Îĵµ£©¡£
ÔõÑùÖØÆô Docker ÈÝÆ÷
ÔÚ Docker ÇéÐÎÖУ¬ÖØÆôÈÝÆ÷ÊÇÒ»ÖÖ³£¼û²Ù×÷£¬¿ÉÒÔ½â¾öÖÖÖÖÎÊÌ⣬ÀýÈçÓ¦ÓóÌÐò¹ÊÕÏ»òÉèÖøü¸Ä¡£ÒÔÏÂÊÇÖØÆô Docker ÈÝÆ÷µÄ°ì·¨£º
1. È·¶¨ÈÝÆ÷ ID
ʹÓà docker ps ÏÂÁî»ñÈ¡ÒªÖØÆôµÄÈÝÆ÷ ID¡£
2. ×èÖ¹ÈÝÆ÷
ʹÓà docker stop ÏÂÁî×èÖ¹ÈÝÆ÷¡£
docker stop <container_id></container_id>
µÇ¼ºó¸´ÖÆ
3. Æô¶¯ÈÝÆ÷
ʹÓà docker start ÏÂÁîÖØÐÂÆô¶¯ÈÝÆ÷¡£
docker start <container_id></container_id>
µÇ¼ºó¸´ÖÆ
4. ÑéÖ¤ÖØÆôÇéÐÎ
ʹÓà docker ps ÏÂÁîÑéÖ¤ÈÝÆ÷ÊÇ·ñÒÑÖØÐÂÆô¶¯¡£
ÆäËûÒªÁì
ʹÓà Docker Compose
ÈôÊÇÄúʹÓõÄÊÇ Docker Compose£¬¿ÉÒÔͨ¹ýÔËÐÐÒÔÏÂÏÂÁîÖØÆôËùÓÐÈÝÆ÷£º
docker-compose restart
µÇ¼ºó¸´ÖÆ
ʹÓà Docker API
Äú»¹¿ÉÒÔʹÓà Docker API ͨ¹ý±à³Ì·½·¨ÖØÆôÈÝÆ÷¡£ÓйØÏêϸÐÅÏ¢£¬Çë²ÎÔÄ Docker Îĵµ¡£
ÒÔÉϾÍÊÇdockerÔõôÖØÆôµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡