dockerÔõô½¨ÉèÈÝÆ÷
ÔÚ docker Öн¨ÉèÈÝÆ÷£º 1. ÀÈ¡¾µÏñ£º docker pull [¾µÏñÃû] 2. ½¨ÉèÈÝÆ÷£º docker run [Ñ¡Ïî] [¾µÏñÃû] [ÏÂÁî] 3. Æô¶¯ÈÝÆ÷£º docker start [ÈÝÆ÷Ãû]
ÔõÑùÔÚ Docker Öн¨ÉèÈÝÆ÷£¿
°ì·¨ 1£ºÀÈ¡¾µÏñ
ÔÚ½¨ÉèÈÝÆ÷֮ǰ£¬ÄúÐèÒªÀÈ¡ÒªÔËÐеľµÏñ¡£Ê¹ÓÃÒÔÏÂÏÂÁ
docker pull [¾µÏñÃû]
µÇ¼ºó¸´ÖÆ
ÀýÈ磺
docker pull nginx
µÇ¼ºó¸´ÖÆ
°ì·¨ 2£º½¨ÉèÈÝÆ÷
ʹÓà docker run ÏÂÁÉèÈÝÆ÷£º
docker run [Ñ¡Ïî] [¾µÏñÃû] [ÏÂÁî]
µÇ¼ºó¸´ÖÆ
³£¼ûÑ¡Ï
-i¡¢–interactive£º ¼á³ÖÈÝÆ÷ÔÚÔËÐÐʱΪ½»»¥Ä£Ê½¡£
-t¡¢–tty£º ·ÖÅÉÒ»¸öαÖնˡ£
–name£º ΪÈÝÆ÷Ö¸¶¨Ò»¸öÃû³Æ¡£
-p£º ¶Ë¿ÚÓ³É䣬½«ÈÝÆ÷¶Ë¿ÚÓ³Éäµ½Ö÷»ú¶Ë¿Ú¡£
ÀýÈ磬½¨ÉèÒ»¸öÃûΪ “my-nginx” µÄ½»»¥Ê½ Nginx ÈÝÆ÷£¬½«ÈÝÆ÷¶Ë¿Ú 80 Ó³Éäµ½Ö÷»ú¶Ë¿Ú 8080£º
docker run -it --name my-nginx -p 8080:80 nginx
µÇ¼ºó¸´ÖÆ
°ì·¨ 3£ºÆô¶¯ÈÝÆ÷
½¨ÉèÈÝÆ÷ºó£¬¿ÉÒÔʹÓà docker start ÏÂÁîÆô¶¯Ëü£º
docker start [ÈÝÆ÷Ãû]
µÇ¼ºó¸´ÖÆ
ÀýÈ磺
docker start my-nginx
µÇ¼ºó¸´ÖÆ
ÆäËûÏÂÁ
docker attach [ÈÝÆ÷Ãû]£º ¸½¼Óµ½ÕýÔÚÔËÐеÄÈÝÆ÷ÖС£
docker stop [ÈÝÆ÷Ãû]£º ×èÖ¹ÈÝÆ÷¡£
docker rm [ÈÝÆ÷Ãû]£º ɾ³ýÈÝÆ÷¡£
ÒÔÉϾÍÊÇdockerÔõô½¨ÉèÈÝÆ÷µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡