dockerÀÈ¡¾µÏñÔõôÉèÖÃ
docker ÀÈ¡¾µÏñʱ¿É×Ô½ç˵ÉèÖ㬰üÀ¨£ºÖ¸¶¨¾µÏñ°æ±¾¡¢¾µÏñ¿ÍÕ»¡¢ÏÞËÙÀÈ¡¡¢Éí·ÝÑéÖ¤ºÍÀÈ¡ÎÞ±êÇ©¾µÏñ¡£ÕâЩÉèÖÿÉͨ¹ý docker pull ÏÂÁî¼°ÆäÑ¡ÏîʵÏÖ£¬°üÀ¨ –registry¡¢–limit-rate¡¢–auth ºÍ -a¡£
ÔõÑùÉèÖà Docker ÀÈ¡¾µÏñ
¼ò½é
Docker ÀÈ¡¾µÏñÓÃÓÚ´Ó Docker ¾µÏñ¿ÍÕ»ÖлñÈ¡ËùÐè¾µÏñ¡£Äú¿ÉÒÔʹÓà docker pull ÏÂÁîÀÈ¡¾µÏñ£¬µ«ÓÐʱÐèÒª¾ÙÐÐÆäËûÉèÖÃÒÔ¿ØÖÆÀÈ¡ÐÐΪ¡£
ÉèÖÃ
ÒÔÏÂÊÇһЩ Docker ÀÈ¡¾µÏñʱ¿ÉÓõÄÉèÖãº
1. Ö¸¶¨¾µÏñ°æ±¾
docker pull <image-name>:<tag></tag></image-name>
µÇ¼ºó¸´ÖÆ
ÆäÖÐ Ö¸¶¨¾µÏñµÄ°æ±¾»ò±êÇ©¡£ÀýÈ磬ҪÀÈ¡ Ubuntu ¾µÏñµÄ×îа汾£¬ÇëʹÓãº
docker pull ubuntu:latest
µÇ¼ºó¸´ÖÆ
2. Ö¸¶¨¾µÏñ¿ÍÕ»
ĬÈÏÇéÐÎÏ£¬Docker »á´Ó Docker Hub£¨¹Ù·½¾µÏñ¿ÍÕ»£©ÀÈ¡¾µÏñ¡£Òª´ÓÆäËû¾µÏñ¿ÍÕ»ÀÈ¡¾µÏñ£¬ÇëʹÓà –registry Ñ¡Ï
docker pull --registry <registry-url><image-name></image-name></registry-url>
µÇ¼ºó¸´ÖÆ
ÀýÈ磬Ҫ´Ó Google ÈÝÆ÷¾µÏñ¿ÍÕ»ÀÈ¡¾µÏñ£¬ÇëʹÓãº
docker pull --registry https://gcr.io google/debian:latest
µÇ¼ºó¸´ÖÆ
3. ÏÞËÙÀÈ¡
ʹÓà –limit-rate Ñ¡Ïî¿ÉÒÔÏÞÖÆÀÈ¡ËÙÂÊ£º
docker pull --limit-rate <bytes-per-second><image-name></image-name></bytes-per-second>
µÇ¼ºó¸´ÖÆ
ÀýÈ磬½«ÀÈ¡ËÙÂÊÏÞÖÆΪÿÃë 1 MB£º
docker pull --limit-rate 1mb <image-name></image-name>
µÇ¼ºó¸´ÖÆ
4. Éí·ÝÑéÖ¤
ijЩ˽ÓоµÏñ¿ÍÕ»ÐèÒªÉí·ÝÑéÖ¤²Å»ª»á¼û¡£Äú¿ÉÒÔʹÓà –auth Ñ¡ÏîÌṩƾ֤£º
docker pull --auth <username>:<password><image-name></image-name></password></username>
µÇ¼ºó¸´ÖÆ
ÀýÈ磬ҪÀȡ˽ÓоµÏñ£¬ÇëʹÓãº
docker pull --auth myusername:mypassword myregistry.io/myimage
µÇ¼ºó¸´ÖÆ
5. ÎÞ±êÇ©¾µÏñ
ÈôÊǾµÏñûÓбêÇ©£¬¿ÉÒÔʹÓà -a Ñ¡ÏîÀÈ¡Ëü£º
docker pull -a <image-name></image-name>
µÇ¼ºó¸´ÖÆ
ÀýÈ磬ҪÀÈ¡ÃûΪ “myimage” µÄÎÞ±êÇ©¾µÏñ£¬ÇëʹÓãº
docker pull -a myimage
µÇ¼ºó¸´ÖÆ
ÆäËû×¢ÖØÊÂÏî
È·±£ÄúÓµÓÐÀÈ¡¾µÏñËùÐèµÄȨÏÞ¡£
Docker »á×Ô¶¯½«ÀÈ¡µÄ¾µÏñ´æ´¢ÔÚÖ÷»úÉϵÄÍâµØ¾µÏñ¿ÍÕ»ÖС£
Äú¿ÉÒÔʹÓà docker images ÏÂÁîÉó²éÍâµØ´æ´¢µÄ¾µÏñ¡£
ÒÔÉϾÍÊÇdockerÀÈ¡¾µÏñÔõôÉèÖõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡