尊龙凯时人生就是博

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

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

СÐò£º

DockerÊÇÒ»ÖÖÊ¢ÐеÄÈÝÆ÷»¯ÊÖÒÕ £¬Ëü¿ÉÒÔ×ÊÖú¿ª·¢Ö°Ô±ÇáËɹ¹½¨ºÍ°²ÅÅÓ¦ÓóÌÐò¡£ÔÚʹÓÃDockerʱ £¬±¸·ÝºÍ»Ö¸´ÈÝÆ÷ÊǺÜÊÇÖ÷ÒªµÄ £¬ÒÔ±£»¤ÎÒÃǵÄÓ¦ÓóÌÐòºÍÊý¾ÝÃâÊÜÒâÍâµÄË𻵻òɥʧ¡£±¾ÎĽ«ÏÈÈÝÔõÑùÔÚLinuxÉÏʹÓÃDocker¾ÙÐÐÈÝÆ÷µÄ±¸·ÝºÍ»Ö¸´²Ù×÷ £¬²¢Ìṩ´úÂëʾÀýÒÔ×ÊÖú¶ÁÕ߸üºÃµØÃ÷È·¡£

Ò»¡¢±¸·ÝÈÝÆ÷

Éó²éÈÝÆ÷Áбí

Ê×ÏÈ £¬ÎÒÃÇÐèÒªÉó²éÄ¿½ñÔËÐеÄÈÝÆ÷Áбí £¬ÒÔÈ·¶¨Òª±¸·ÝµÄÈÝÆ÷¡£¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´Éó²éÈÝÆ÷ÁÐ±í£º

docker ps

µÇ¼ºó¸´ÖÆ

±¸·ÝÈÝÆ÷

±¸·ÝÈÝÆ÷ºÜÊǼòÆÓ £¬Ö»Ð轫ÈÝÆ÷´ò°ü³ÉÒ»¸ö¾µÏñ¼´¿É¡£ÒÔÏÂÊDZ¸·ÝÈÝÆ÷µÄÏÂÁîʾÀý£º

docker commit <ÈÝÆ÷ID> <¾µÏñÃû>:<±êÇ©>

µÇ¼ºó¸´ÖÆ

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

µ¼³ö¾µÏñ

±¸·ÝÈÝÆ÷ºó £¬ÎÒÃÇ¿ÉÒÔ½«±¸·ÝµÄ¾µÏñµ¼³öµ½Ò»¸ö.tarÎļþÖÐ £¬ÒԱ㽫ÆäÉúÑÄÔÚÍâµØ»òǨáãµ½ÆäËû»úеÉÏ¡£ÒÔÏÂÊǵ¼³ö¾µÏñµÄÏÂÁîʾÀý£º

docker save -o <ÎļþÃû>.tar <¾µÏñÃû>:<±êÇ©>

µÇ¼ºó¸´ÖÆ

ÆäÖÐ £¬ÎļþÃûÊǵ¼³öµÄÎļþÃû £¬¾µÏñÃûºÍ±êÇ©ÊÇ֮ǰ±¸·ÝµÄ¾µÏñµÄÃû³ÆºÍ±êÇ©¡£

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

¶þ¡¢»Ö¸´ÈÝÆ÷

µ¼Èë¾µÏñ

ÔÚ»Ö¸´ÈÝÆ÷֮ǰ £¬ÎÒÃÇÊ×ÏÈÒªµ¼È뱸·ÝµÄ¾µÏñ¡£¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîµ¼È뱸·ÝµÄ¾µÏñ£º

docker load -i <ÎļþÃû>.tar

µÇ¼ºó¸´ÖÆ

ÆäÖÐ £¬ÎļþÃûÊÇ֮ǰ±¸·ÝµÄ.tarÎļþÃû¡£

½¨ÉèÈÝÆ÷

±¸·ÝµÄ¾µÏñµ¼Èëºó £¬ÎÒÃÇ¿ÉÒÔʹÓÃËüÀ´½¨ÉèÒ»¸öеÄÈÝÆ÷¡£ÒÔÏÂÊǽ¨ÉèÈÝÆ÷µÄÏÂÁîʾÀý£º

docker run -d --name <ÈÝÆ÷Ãû> <¾µÏñÃû>:<±êÇ©>

µÇ¼ºó¸´ÖÆ

ÆäÖÐ £¬ÈÝÆ÷ÃûÊÇн¨ÉèÈÝÆ÷µÄÃû³Æ £¬¾µÏñÃûºÍ±êÇ©ÊÇ֮ǰ±¸·ÝµÄ¾µÏñµÄÃû³ÆºÍ±êÇ©¡£

»Ö¸´Êý¾Ý

ÔÚ½¨ÉèÈÝÆ÷ºó £¬ÎÒÃÇ»¹ÐèÒª»Ö¸´ÈÝÆ÷ÖеÄÊý¾Ý¡£Ò»Ñùƽ³£ÇéÐÎÏ £¬ÈÝÆ÷ÖеÄÊý¾Ýͨ³£´æ´¢ÔÚ¾íÖÐ £¬Òò´ËÎÒÃÇÐèÒª¹ÒÔؾíÀ´»Ö¸´Êý¾Ý¡£ÒÔÏÂÊǻָ´Êý¾ÝµÄÏÂÁîʾÀý£º

docker run -d --name <ÈÝÆ÷Ãû> -v <Ö÷»úĿ¼>:<ÈÝÆ÷Ŀ¼> <¾µÏñÃû>:<±êÇ©>

µÇ¼ºó¸´ÖÆ

ÆäÖÐ £¬ÈÝÆ÷ÃûÊÇн¨ÉèÈÝÆ÷µÄÃû³Æ £¬Ö÷»úĿ¼ÊÇ´æ´¢Êý¾ÝµÄÖ÷»úĿ¼ £¬ÈÝÆ÷Ŀ¼ÊÇÈÝÆ÷ÖÐÓÃÓÚ´æ´¢Êý¾ÝµÄĿ¼ £¬¾µÏñÃûºÍ±êÇ©ÊÇ֮ǰ±¸·ÝµÄ¾µÏñµÄÃû³ÆºÍ±êÇ©¡£

Èý¡¢´úÂëʾÀý

ÒÔÏÂÊÇÒ»¸öÍêÕûµÄ±¸·ÝºÍ»Ö¸´ÈÝÆ÷µÄʾÀý£º

# ±¸·ÝÈÝÆ÷
docker commit <ÈÝÆ÷ID> <¾µÏñÃû>:<±êÇ©>

# µ¼³ö¾µÏñ
docker save -o <ÎļþÃû>.tar <¾µÏñÃû>:<±êÇ©>

# µ¼Èë¾µÏñ
docker load -i <ÎļþÃû>.tar

# ½¨ÉèÈÝÆ÷
docker run -d --name <ÈÝÆ÷Ãû> <¾µÏñÃû>:<±êÇ©>

# »Ö¸´Êý¾Ý
docker run -d --name <ÈÝÆ÷Ãû> -v <Ö÷»úĿ¼>:<ÈÝÆ÷Ŀ¼> <¾µÏñÃû>:<±êÇ©>

µÇ¼ºó¸´ÖÆ

×ܽ᣺

±¸·ÝºÍ»Ö¸´ÈÝÆ÷ÊǺÜÊÇÖ÷ÒªµÄ £¬ÒÔ±£»¤ÎÒÃǵÄÓ¦ÓóÌÐòºÍÊý¾ÝÃâÊÜÒâÍâµÄË𻵻òɥʧ¡£Í¨¹ýʹÓÃDockerÌṩµÄÏÂÁîºÍÊÖÒÕ £¬ÎÒÃÇ¿ÉÒÔÇáËɵر¸·ÝºÍ»Ö¸´ÈÝÆ÷¡£Ö»Ð輸¸ö¼òÆӵİ취 £¬¼´¿ÉÍê³ÉÈÝÆ÷µÄ±¸·ÝºÍ»Ö¸´²Ù×÷¡£¿ÉÊÇÇë×¢ÖØ £¬ÔÚ¾ÙÐб¸·ÝºÍ»Ö¸´²Ù×÷֮ǰ £¬ÇëÈ·±£ÄãµÄÈÝÆ÷ºÍÓ¦ÓóÌÐò´¦ÓÚ¿É¿¿µÄ״̬¡£

²Î¿¼£º

Docker Documentation: https://docs.docker.com/

Docker CLI Reference: https://docs.docker.com/engine/reference/commandline/cli/

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

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

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是博

13452372176

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

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

QR code
sitemap¡¢ÍøÕ¾µØͼ