dockerÔõô´î½¨Ë½ÓпÍÕ»
Äú¿ÉÒÔ¹¹½¨ docker ˽ÓпÍÕ»ÒÔÇå¾²µØ´æ´¢ºÍÖÎÀíÈÝÆ÷¾µÏñ£¬ÌṩÑÏ¿áµÄ¿ØÖƺÍÇå¾²ÐÔ¡£°ì·¨°üÀ¨£º½¨Éè´æ´¢¿â¡¢ÊÚÓè»á¼ûȨÏÞ¡¢°²ÅÅ¿ÍÕ»¡¢ÍÆË;µÏñºÍÀÈ¡¾µÏñ¡£Óŵã°üÀ¨Çå¾²ÐÔ¡¢°æ±¾¿ØÖÆ¡¢ïÔÌÍøÂçÁ÷Á¿ºÍ¶¨ÖÆ»¯¡£
ÔõÑù¹¹½¨ Docker ˽ÓпÍÕ»
Docker ˽ÓпÍÕ»ÔÊÐíÄúÇå¾²µØ´æ´¢ºÍÖÎÀí×Ô¼ºµÄÈÝÆ÷¾µÏñ¡£Ó빫¹²¿ÍÕ»Ïà±È£¬ËüÌṩÁ˸üÑÏ¿áµÄ¿ØÖƺÍÇå¾²ÐÔ¡£ÒÔÏÂÊǹ¹½¨ Docker ˽ÓпÍÕ»µÄ°ì·¨£º
1. ½¨Éè´æ´¢¿â
ʹÓÃÒÔÏÂÏÂÁÉè˽ÓпÍÕ»£º
docker registry login
µÇ¼ºó¸´ÖÆ
ÊäÈëÄúµÄ Docker Hub ƾ֤¡£
½¨ÉèÒ»¸öпÍÕ»£º
docker repository create my-repo
µÇ¼ºó¸´ÖÆ
2. ÊÚÓè»á¼ûȨÏÞ
ΪÆäËûÓû§ÊÚÓè¶Ô¿ÍÕ»µÄ»á¼ûȨÏÞ£º
docker repository add-collaborator my-repo user
µÇ¼ºó¸´ÖÆ
3. °²ÅÅ¿ÍÕ»
°²ÅÅ¿ÍÕ»µÄÁ½ÖÖ³£¼ûÒªÁ죺
ʹÓà Docker Engine£ºÔËÐÐÒÔÏÂÏÂÁ
docker run -it --rm --name registry \ -p 5000:5000 \ registry:2
µÇ¼ºó¸´ÖÆ
ʹÓà Docker Compose£º½¨Éè docker-compose.yml Îļþ£¬ÈçÏÂËùʾ£º
version: '3' services: registry: image: registry:2 ports: - "5000:5000"
µÇ¼ºó¸´ÖÆ
È»ºóÔËÐÐÒÔÏÂÏÂÁ
docker-compose up -d
µÇ¼ºó¸´ÖÆ
4. ÍÆË;µÏñ
¹¹½¨ÄúµÄ¾µÏñ²¢Ê¹ÓÃÒÔÏÂÏÂÁÆäÍÆË͵½¿ÍÕ»£º
docker push my-repo/my-image:latest
µÇ¼ºó¸´ÖÆ
5. ÀÈ¡¾µÏñ
´Ó¿ÍÕ»ÖÐÀÈ¡¾µÏñ£º
docker pull my-repo/my-image:latest
µÇ¼ºó¸´ÖÆ
ʹÓÃ˽ÓпÍÕ»µÄÓŵã
Çå¾²£º¿ØÖƶԾµÏñµÄ»á¼û£¬±ÜÃâδ¾ÊÚȨµÄ»á¼û¡£
°æ±¾¿ØÖÆ£º¸ú×Ù¾µÏñµÄ°æ±¾£¬ÔÊÐíÇáËɻعöµ½ÒÔÇ°µÄ°æ±¾¡£
ïÔÌÍøÂçÁ÷Á¿£ºÊ¹ÓÃÍâµØ¾µÏñ£¬×èÖ¹´Ó¹«¹²¿ÍÕ»ÏÂÔؾµÏñµÄÍøÂ翪Ïú¡£
¶¨ÖÆ»¯£º½¨ÉèºÍά»¤×Ô¼ºµÄ¾µÏñ£¬Æ¾Ö¤ÄúµÄÌض¨ÐèÇó¾ÙÐж¨ÖÆ¡£
ÒÔÉϾÍÊÇdockerÔõô´î½¨Ë½ÓпÍÕ»µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡