docker¾µÏñÔõôÉúÑÄ
ÔÚ docker ÖÐÉúÑľµÏñ£¬¿ÉÒÔʹÓà docker commit ÏÂÁÉèеľµÏñ£¬°üÀ¨Ö¸¶¨ÈÝÆ÷µÄÄ¿½ñ״̬£¬Ó﷨Ϊ£ºdocker commit [Ñ¡Ïî] ÈÝÆ÷id ¾µÏñÃû³Æ¡£ÒªÉúÑľµÏñµ½¿ÍÕ»£¬¿ÉÒÔʹÓà docker push ÏÂÁÓ﷨Ϊ£ºdocker push ¾µÏñÃû³Æ[:±êÇ©]¡£Òªµ¼ÈëÒÑÉúÑĵľµÏñ£¬¿ÉÒÔʹÓà docker pull ÏÂÁÓ﷨Ϊ£ºdocker pull ¾µÏñÃû³Æ[:±êÇ©]¡£
ÔõÑùÔÚ Docker ÖÐÉúÑľµÏñ
ÉúÑľµÏñ
ÒªÉúÑÄ Docker ¾µÏñ£¬¿ÉÒÔʹÓà docker commit ÏÂÁî¡£´ËÏÂÁ½¨ÉèÒ»¸öеľµÏñ£¬ÆäÖаüÀ¨Ö¸¶¨ÈÝÆ÷µÄÄ¿½ñ״̬¡£
Óï·¨
docker commit [Ñ¡Ïî] ÈÝÆ÷ID [¾µÏñÃû³Æ][:±êÇ©]
µÇ¼ºó¸´ÖÆ
Ñ¡Ïî
-a ×÷Õß: ÉèÖþµÏñ×÷ÕßÐÅÏ¢¡£
-m ×¢ÊÍ: Ϊ¾µÏñÌí¼Ó×¢ÊÍ¡£
-c Ìá½»: ´ÓÈÝÆ÷Öи´ÖÆÖ¸¶¨µÄÈÝÆ÷ÉèÖá£
-q ¾²Ä¬: ²»ÏÔʾÈκÎÊä³ö¡£
ʾÀý
ÉúÑÄÃûΪ my-app µÄÈÝÆ÷ΪоµÏñ my-image£º
docker commit -m "Initial commit" my-app my-image:latest
µÇ¼ºó¸´ÖÆ
ÉúÑľµÏñµ½¿ÍÕ»ÖÐ
Òª½«¾µÏñÉúÑĵ½ Docker ¿ÍÕ»£¨Èç Docker Hub£©£¬¿ÉÒÔʹÓà docker push ÏÂÁî¡£
Óï·¨
docker push ¾µÏñÃû³Æ[:±êÇ©]
µÇ¼ºó¸´ÖÆ
ʾÀý
½« my-image ¾µÏñÍÆË͵½ Docker Hub ¿ÍÕ» my-repo£º
docker push my-repo/my-image:latest
µÇ¼ºó¸´ÖÆ
µ¼Èë¾µÏñ
Òªµ¼ÈëÒÑÉúÑĵľµÏñ£¬¿ÉÒÔʹÓà docker pull ÏÂÁî¡£
Óï·¨
docker pull ¾µÏñÃû³Æ[:±êÇ©]
µÇ¼ºó¸´ÖÆ
ʾÀý
´Ó Docker Hub ÀÈ¡ my-repo/my-image:latest ¾µÏñ£º
docker pull my-repo/my-image:latest
µÇ¼ºó¸´ÖÆ
¸½¼ÓÐÅÏ¢
Äú¿ÉÒÔʹÓà docker images ÏÂÁîÉó²éÒÑÉúÑĵľµÏñ¡£
Äú¿ÉÒÔʹÓà docker inspect ÏÂÁîÉó²é¾µÏñµÄÏêϸÐÅÏ¢¡£
Äú¿ÉÒÔʹÓà docker tag ÏÂÁî¸ü¸Ä¾µÏñµÄ±êÇ©»òÃû³Æ¡£
ÒÔÉϾÍÊÇdocker¾µÏñÔõôÉúÑĵÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡