docker¾µÏñÎļþÔõôÔËÐÐ
ÒªÔËÐÐ docker ¾µÏñ£¬ÐèÒªÖ´ÐÐÒÔÏ°취£ºÀÈ¡¾µÏñ£ºÊ¹Óà docker pull ÏÂÁîÀÈ¡ËùÐèµÄ¾µÏñ¡£½¨ÉèÈÝÆ÷£ºÊ¹Óà docker run ÏÂÁÉèÈÝÆ÷£¬Ö¸ÃüÃû³ÆºÍ¶Ë¿ÚÓ³Éä¡£Æô¶¯ÈÝÆ÷£ºÊ¹Óà docker start ÏÂÁîÆô¶¯ÈÝÆ÷¡£ÊÓ²ìÈÕÖ¾£ºÊ¹Óà docker logs ÏÂÁîÉó²éÈÝÆ÷ÈÕÖ¾¡£×èÖ¹ÈÝÆ÷£ºÊ¹Óà docker stop ÏÂÁî×èÖ¹ÈÝÆ÷¡£ÖÕÖ¹ÈÝÆ÷£ºÊ¹Óà docker rm ÏÂÁîÖÕÖ¹ÈÝÆ÷²¢É¾³ýÊý¾Ý¡£
ÔõÑùÔËÐÐ Docker ¾µÏñÎļþ
Docker ¾µÏñÊÇÒ»ÖÖÇáÁ¿¼¶µÄ¡¢×ÔÁ¦µÄ¡¢¿ÉÖ´ÐÐÈí¼þ°ü£¬Ëü°üÀ¨ÔËÐÐÌض¨Ó¦ÓóÌÐò»òЧÀ͵ÄËùÐèÎļþºÍ´úÂë¡£ÒªÔËÐÐ Docker ¾µÏñ£¬ÐèҪʹÓà Docker ÈÝÆ÷ÒýÇæ¡£
ÔËÐÐ Docker ¾µÏñµÄ°ì·¨£º
ÀÈ¡¾µÏñ£ºÊ×ÏÈ£¬ÐèҪʹÓà docker pull ÏÂÁî´Ó Docker ¾µÏñ¿ÍÕ»ÖÐÀÈ¡ËùÐèµÄ¾µÏñ¡£ÀýÈ磬ҪÀÈ¡ Nginx ¾µÏñ£º
docker pull nginx
µÇ¼ºó¸´ÖÆ
½¨ÉèÈÝÆ÷£ºÀÈ¡¾µÏñºó£¬¿ÉÒÔʹÓà docker run ÏÂÁÉèÈÝÆ÷¡£ÈÝÆ÷ÊǾµÏñµÄ¿ÉÔËÐÐʵÀý¡£ÔÚÒÔÏÂÏÂÁîÖУ¬–name Ñ¡Ïî¿ÉΪÈÝÆ÷Ö¸ÃüÃû³Æ£¬-p Ñ¡Ïî¿É½«ÈÝÆ÷¶Ë¿ÚÓ³Éäµ½Ö÷»ú¶Ë¿Ú£º
docker run --name nginx-container -p 80:80 nginx
µÇ¼ºó¸´ÖÆ
Æô¶¯ÈÝÆ÷£ºÈÝÆ÷½¨Éèºó£¬ÐèҪʹÓà docker start ÏÂÁîÆô¶¯Ëü£º
docker start nginx-container
µÇ¼ºó¸´ÖÆ
ÊÓ²ìÈÝÆ÷ÈÕÖ¾£º¿ÉÒÔͨ¹ý docker logs ÏÂÁîÉó²éÈÝÆ÷µÄÈÕÖ¾Êä³ö£º
docker logs nginx-container
µÇ¼ºó¸´ÖÆ
×èÖ¹ÈÝÆ÷£ºÒª×èÖ¹ÈÝÆ÷£¬¿ÉÒÔʹÓà docker stop ÏÂÁ
docker stop nginx-container
µÇ¼ºó¸´ÖÆ
ÖÕÖ¹ÈÝÆ÷£ºÒªÖÕÖ¹ÈÝÆ÷²¢É¾³ýËùÓÐÊý¾Ý£¬¿ÉÒÔʹÓà docker rm ÏÂÁ
docker rm nginx-container
µÇ¼ºó¸´ÖÆ
ÆäËûÌáÐÑ£º
È·±£ÒÑ×°Öò¢ÔËÐÐ Docker ÈÝÆ÷ÒýÇæ¡£
ͨ¹ý docker images ÏÂÁîÉó²é¿ÉÓõľµÏñ¡£
ʹÓà docker inspect ÏÂÁîÉó²é¾µÏñ»òÈÝÆ÷µÄÏêϸÄÚÈÝ¡£
¿ÉÒÔʹÓà docker-compose ¹¤¾ß±àÅźÍÖÎÀí¶à¸öÈÝÆ÷¡£
ÒÔÉϾÍÊÇdocker¾µÏñÎļþÔõôÔËÐеÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡