docker desktopÔõôÓÃ
ÔõÑùʹÓà docker desktop£¿docker desktop ÊÇÒ»¿î¹¤¾ß£¬ÓÃÓÚÔÚÍâµØ»úеÉÏÔËÐÐ docker ÈÝÆ÷¡£ÆäʹÓð취°üÀ¨£º1. ×°Öà docker desktop£»2. Æô¶¯ docker desktop£»3. ½¨Éè docker ¾µÏñ£¨Ê¹Óà dockerfile£©£»4. ¹¹½¨ docker ¾µÏñ£¨Ê¹Óà docker build£©£»5. ÔËÐÐ docker ÈÝÆ÷£¨Ê¹Óà docker run£©¡£
Docker Desktop ʹÓÃÖ¸ÄÏ
ÔõÑùʹÓà Docker Desktop£¿
Docker Desktop ÊÇÒ»¸öÓÃÓÚÔÚÍâµØÅÌËã»úÉÏÔËÐÐ Docker ÈÝÆ÷µÄ¹¤¾ß¡£ÒªÊ¹Óà Docker Desktop£º
×°Öà Docker Desktop£º»á¼û Docker ¹ÙÍøÏÂÔز¢×°Öà Docker Desktop£¬ÊÊÓÃÓÚ Mac¡¢Windows ºÍ Linux¡£
Æô¶¯ Docker Desktop£º×°Öúó£¬Æô¶¯ Docker Desktop Ó¦ÓóÌÐò¡£
½¨Éè Docker ¾µÏñ£ºÊ¹Óà Dockerfile ½¨Éè Docker ¾µÏñ£¬¸ÃÎļþ½ç˵ÁËÈÝÆ÷µÄÉèÖúÍÄÚÈÝ¡£
¹¹½¨ Docker ¾µÏñ£ºÔËÐÐ docker build ÏÂÁîÀ´¹¹½¨¾µÏñ¡£
ÔËÐÐ Docker ÈÝÆ÷£ºÔËÐÐ docker run ÏÂÁîÀ´ÔËÐÐÈÝÆ÷¡£
Ïêϸ˵Ã÷
1. ×°ÖÃ Docker Desktop
»á¼û Docker ¹ÙÍø£¬Ñ¡ÔñÓëÄúµÄ²Ù×÷ϵͳƥÅäµÄ×°Öðü¡£Æ¾Ö¤×°ÖÃ˵Ã÷¾ÙÐвÙ×÷¡£
2. Æô¶¯ Docker Desktop
×°Öú󣬴ÓÓ¦ÓóÌÐòÆô¶¯Æ÷ÖÐÆô¶¯ Docker Desktop Ó¦ÓóÌÐò¡£Ëü½«ÔÚÄúµÄÍÐÅÌ»ò²Ëµ¥À¸ÖÐÔËÐС£
3. ½¨Éè Dockerfile
Dockerfile ÊÇÒ»¸öÎı¾Îļþ£¬ÓÃÓÚ½ç˵ Docker ¾µÏñµÄÉèÖúÍÄÚÈÝ¡£Ëü°üÀ¨£º
»ù´¡¾µÏñ£ºÒªÊ¹ÓõĻù´¡¾µÏñ
Ö¸Áָ¶¨ÒªÖ´ÐеIJÙ×÷£¨ÀýÈ磬Ìí¼ÓÎļþ¡¢ÔËÐÐÏÂÁ
4. ¹¹½¨ Docker ¾µÏñ
ʹÓà docker build ÏÂÁî¹¹½¨¾µÏñ£º
docker build -t <image-name><path-to-dockerfile></path-to-dockerfile></image-name>
µÇ¼ºó¸´ÖÆ
£º¾µÏñÃû³Æ
£ºDockerfile ·¾¶
5. ÔËÐÐ Docker ÈÝÆ÷
ʹÓà docker run ÏÂÁîÔËÐÐÈÝÆ÷£º
docker run -it --rm --name <container-name><image-name></image-name></container-name>
µÇ¼ºó¸´ÖÆ
£ºÈÝÆ÷Ãû³Æ
£º¾µÏñÃû³Æ
-it£º½»»¥Ê½ÖÕ¶Ë
–rm£ºÈÝÆ÷Í˳öºóɾ³ý
–name£ºÎªÈÝÆ÷·ÖÅÉÒ»¸öÃû³Æ£¨¿ÉÑ¡£©
ÌáÐÑ
ʹÓà docker ps Éó²éÕýÔÚÔËÐеÄÈÝÆ÷¡£
ʹÓà docker stop ×èÖ¹ÈÝÆ÷¡£
ʹÓà docker rm ɾ³ýÈÝÆ÷¡£
ʹÓà docker image ls Éó²éÒѹ¹½¨µÄ¾µÏñ¡£
ʹÓà docker image rm ɾ³ý¾µÏñ¡£
ÒÔÉϾÍÊÇdocker desktopÔõôÓõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡