ÔõôÆô¶¯docker¾µÏñ
Æô¶¯ docker ¾µÏñµÄ°ì·¨ÈçÏ£ºÀÈ¡¾µÏñ£º´Ó×¢²á±íÖлñÈ¡¾µÏñ¡£½¨ÉèÈÝÆ÷£º·ÖÅÉ×ÊÔ´²¢½¨Éè»ùÓÚ¾µÏñµÄÈÝÆ÷¡£Æô¶¯ÈÝÆ÷£ºÆô¶¯ÈÝÆ÷ÖеÄÀú³Ì¡£ÅþÁ¬µ½ÈÝÆ÷£ºÓëÈÝÆ÷½»»¥²¢Ö´ÐÐÏÂÁî¡£
ÔõÑùÆô¶¯ Docker ¾µÏñ
Æô¶¯ Docker ¾µÏñµÄ°ì·¨£º
ÀÈ¡¾µÏñ£ºÊ¹Óà docker pull ÏÂÁî´Ó Docker Hub »òÆäËû×¢²á±íÀÈ¡ËùÐèµÄ¾µÏñ¡£ÀýÈ磺docker pull ubuntu:latest
½¨ÉèÈÝÆ÷£ºÊ¹Óà docker run ÏÂÁÉèÒ»¸ö»ùÓÚËùÀÈ¡¾µÏñµÄÐÂÈÝÆ÷¡£Äú¿ÉÒÔÖ¸¶¨ÈÝÆ÷µÄÃû³Æ¡¢·ÖÅɵÄ×ÊÔ´ºÍÒªÔËÐеÄÏÂÁî¡£ÀýÈ磺docker run -it –name my-ubuntu ubuntu:latest bash
Æô¶¯ÈÝÆ÷£ºÊ¹Óà docker start ÏÂÁîÆô¶¯Òѽ¨É赫δÔËÐеÄÈÝÆ÷¡£ÀýÈ磺docker start my-ubuntu
ÅþÁ¬µ½ÈÝÆ÷£ºÊ¹Óà docker attach »ò docker exec ÏÂÁîÅþÁ¬µ½ÕýÔÚÔËÐеÄÈÝÆ÷¡£ÕâÔÊÐíÄúÓëÈÝÆ÷½»»¥²¢Ö´ÐÐÏÂÁî¡£ÀýÈ磺docker exec -it my-ubuntu bash
Ïêϸ˵Ã÷£º
ÀÈ¡¾µÏñ£ºÔÚÀÈ¡¾µÏñʱ£¬Docker »á´Ó×¢²á±íÏÂÔؾµÏñµÄËùÓв㣬²¢½«Æä´æ´¢ÔÚÍâµØ¡£
½¨ÉèÈÝÆ÷£º½¨ÉèÈÝÆ÷ʱ£¬Docker »áÔÚÖ÷»úÉÏ·ÖÅÉ×ÊÔ´£¬ÀýÈç CPU¡¢ÄÚ´æºÍ´æ´¢¡£Ëü»¹»á½¨ÉèÈÝÆ÷µÄÍøÂçÃüÃû¿Õ¼ä£¬²¢½«ÆäÅþÁ¬µ½Ö÷»úÍøÂç¡£
Æô¶¯ÈÝÆ÷£ºÆô¶¯ÈÝÆ÷ʱ£¬Docker »áÆô¶¯ÈÝÆ÷ÖеÄÀú³Ì¡£ÈÝÆ÷»áÒ»Ö±ÔËÐУ¬Ö±µ½Ëü×èÖ¹»òÍ˳ö¡£
ÅþÁ¬µ½ÈÝÆ÷£ºÅþÁ¬µ½ÕýÔÚÔËÐеÄÈÝÆ÷ʱ£¬Äú¿ÉÒÔÖ±½ÓÓëÈÝÆ÷½»»¥¡£Õâ¹ØÓÚ¹ÊÕÏɨ³ý¡¢µ÷ÊÔ»òÔÚÈÝÆ÷ÖÐÔËÐÐÏÂÁîºÜÊÇÓÐÓá£
ÒÔÉϾÍÊÇÔõôÆô¶¯docker¾µÏñµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡