×ðÁú¿­Ê±¹ÙÍøµÇ¼

ÔõÑùÔÚLinuxÉÏʹÓÃDocker¾ÙÐÐÈÝÆ÷µÄ¿ìËÙ±¸·ÝºÍ»Ö¸´£¿

ÔõÑùÔÚlinuxÉÏʹÓÃdocker¾ÙÐÐÈÝÆ÷µÄ¿ìËÙ±¸·ÝºÍ»Ö¸´£¿

ͻ񻣼

ÔÚʹÓÃDocker¾ÙÐÐÓ¦ÓóÌÐò¿ª·¢ºÍ°²ÅŵÄÀú³ÌÖÐ £¬ÈÝÆ÷µÄ±¸·ÝºÍ»Ö¸´ÊÇÒ»ÏîÖ÷ÒªµÄʹÃü¡£±¾ÎĽ«ÏÈÈÝÔõÑùÔÚLinuxÉÏʹÓÃDocker¾ÙÐÐÈÝÆ÷µÄ¿ìËÙ±¸·ÝºÍ»Ö¸´ £¬²¢ÌṩÏìÓ¦µÄ´úÂëʾÀý¡£

СÐò£º

ÔÚÏÖ´ú¿ª·¢ÇéÐÎÖÐ £¬Ê¹ÓÃDockerÈÝÆ÷»¯Ó¦ÓóÌÐòÒѳÉΪһÖÖÖ÷Á÷µÄÊÖÒÕÑ¡Ôñ¡£Ê¹ÓÃDocker¿ÉÒÔÌṩӦÓóÌÐòµÄ¿ÉÒÆÖ²ÐԺ͸ôÀëÐÔ £¬Ê¹µÃ¿ª·¢ºÍ°²ÅűäµÃÔ½·¢¼òÆӺ͸ßЧ¡£È»¶ø £¬ÔÚÏÖʵӦÓÃÖÐ £¬ÈÝÆ÷µÄ±¸·ÝºÍ»Ö¸´ÊÇ°ü¹ÜÊý¾ÝÇå¾²ÐÔºÍÓªÒµÒ»Á¬ÐÔµÄÖ÷Òª»·½Ú¡£±¾ÎĽ«ÏÈÈÝÔõÑùʹÓÃDockerÏÂÁî¾ÙÐÐÈÝÆ÷µÄ¿ìËÙ±¸·ÝºÍ»Ö¸´ £¬²¢ÌṩÏìÓ¦µÄ´úÂëʾÀý¡£

±¸·ÝÈÝÆ÷£º

ʹÓÃDocker¾ÙÐÐÈÝÆ÷±¸·ÝºÜ¼òÆÓ £¬Ö»ÐèҪʹÓÃdocker commitÏÂÁîÀ´ÉúÑÄÈÝÆ÷µÄÄ¿½ñ״̬¡£ÏÂÃæÊÇÒ»¸ö±¸·ÝÈÝÆ÷µÄʾÀý´úÂ룺

# ±¸·ÝÈÝÆ÷
docker commit <container_id> <backup_image_name>

µÇ¼ºó¸´ÖÆ

ÆäÖÐ £¬ ÊÇÒª±¸·ÝµÄÈÝÆ÷µÄID £¬ ÊDZ¸·ÝºóµÄ¾µÏñµÄÃû³Æ¡£

µã»÷ÏÂÔØ¡°àËÃûÌÃÊý¾Ý»Ö¸´¾Þ½³¡±£»

ÀýÈç £¬Òª±¸·ÝÒ»¸öÃûΪmy_containerµÄÈÝÆ÷ £¬¿ÉÒÔÖ´ÐÐÒÔÏÂÏÂÁ

docker commit my_container my_backup_image

µÇ¼ºó¸´ÖÆ

Õ⽫½¨ÉèÒ»¸öÃûΪmy_backup_imageµÄоµÏñ £¬Æä°üÀ¨ÁËÈÝÆ÷µÄÄ¿½ñ״̬¡£

»Ö¸´ÈÝÆ÷£º

ÔÚÐèÒª»Ö¸´±¸·ÝµÄÈÝÆ÷ʱ £¬ÎÒÃÇ¿ÉÒÔʹÓÃdocker runÏÂÁî»ùÓÚ±¸·ÝµÄ¾µÏñÀ´½¨ÉèÒ»¸öеÄÈÝÆ÷¡£ÒÔÏÂÊÇÒ»¸ö»Ö¸´ÈÝÆ÷µÄʾÀý´úÂ룺

# »Ö¸´ÈÝÆ÷
docker run --name <new_container_name> -d <backup_image_name>

µÇ¼ºó¸´ÖÆ

ÆäÖÐ £¬ ÊÇÒª½¨ÉèµÄÐÂÈÝÆ÷µÄÃû³Æ £¬ ÊÇ֮ǰ±¸·ÝµÄ¾µÏñµÄÃû³Æ¡£

ÀýÈç £¬Òª»Ö¸´Ö®Ç°±¸·ÝµÄmy_backup_image¾µÏñΪһ¸öÃûΪmy_new_containerµÄÈÝÆ÷ £¬¿ÉÒÔÖ´ÐÐÒÔÏÂÏÂÁ

docker run --name my_new_container -d my_backup_image

µÇ¼ºó¸´ÖÆ

Õ⽫½¨ÉèÒ»¸öеÄÈÝÆ÷ £¬ÆäÃû³ÆΪmy_new_container £¬²¢»ùÓÚ±¸·ÝµÄ¾µÏñÔËÐС£

×ܽ᣺

ͨ¹ýʹÓÃDockerÏÂÁî¾ÙÐÐÈÝÆ÷µÄ¿ìËÙ±¸·ÝºÍ»Ö¸´ £¬ÎÒÃÇ¿ÉÒÔÇáËɵر£»¤ÎÒÃǵÄÓ¦ÓóÌÐòºÍÊý¾Ý¡£ÔÚÏÖʵӦÓÃÖÐ £¬ÎÒÃÇ¿ÉÒÔʹÓÃÕâЩ¹¦Ð§À´°´ÆÚ±¸·ÝÈÝÆ÷ £¬ÒÔ±ãÔÚÐèҪʱ¿ìËÙ»Ö¸´¡£Í¨¹ý´úÂëʾÀýµÄÏÈÈÝ £¬¶ÁÕß¿ÉÒÔÔ½·¢ÇåÎúµØÏàʶÔõÑùÔÚLinuxÉÏʹÓÃDocker¾ÙÐÐÈÝÆ÷±¸·ÝºÍ»Ö¸´¡£Í¬Ê± £¬ÎÒÃÇÒ²ÐèÒª°ü¹Ü±¸·ÝÊý¾ÝµÄÇå¾²ÐԺͿɿ¿ÐÔ £¬ÒÔÈ·±£ÓªÒµµÄÒ»Á¬ÐÔºÍÊý¾ÝµÄÍêÕûÐÔ¡£

ÒÔÉϾÍÊÇÔõÑùÔÚLinuxÉÏʹÓÃDocker¾ÙÐÐÈÝÆ÷µÄ¿ìËÙ±¸·ÝºÍ»Ö¸´£¿µÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ