尊龙凯时人生就是博

ÔõÑùʹÓÃDocker¾ÙÐÐÈÝÆ÷µÄ×ÊÔ´ÏÞÖƺÍÐÔÄܵ÷ÓÅ

ÔõÑùʹÓÃDocker¾ÙÐÐÈÝÆ÷µÄ×ÊÔ´ÏÞÖƺÍÐÔÄܵ÷ÓÅ

СÐò£º

ÔÚÈí¼þ¿ª·¢ºÍ°²ÅÅÀú³ÌÖÐ £¬ÈÝÆ÷»¯ÊÖÒÕÒѾ­³ÉΪÁËÏ൱ʢÐкÍÖ÷ÒªµÄÑ¡Ôñ¡£Docker×÷ΪĿ½ñ×î×ÅÃûµÄÈÝÆ÷»¯¹¤¾ßÖ®Ò» £¬Îª¿ª·¢Ö°Ô±ÌṩÁËÒ»ÖÖÀû±ã¡¢ÇáÁ¿¼¶ºÍ¿ÉÒÆÖ²µÄ°²ÅŽâ¾ö¼Æ»®¡£È»¶ø £¬ºÏÀíµØÏÞÖÆÈÝÆ÷µÄ×ÊԴʹÓúÍÓÅ»¯ÈÝÆ÷µÄÐÔÄÜ £¬¹ØÓÚ°ü¹ÜÈÝÆ÷ÇéÐεÄÎȹÌÐÔºÍÐÔÄÜÌåÏÖºÜÊÇÖ÷Òª¡£±¾ÎĽ«ÏÈÈÝÔõÑùʹÓÃDocker¾ÙÐÐÈÝÆ÷µÄ×ÊÔ´ÏÞÖƺÍÐÔÄܵ÷ÓÅ £¬²¢ÌṩһЩÏêϸµÄ´úÂëʾÀý¡£

Ò»¡¢×ÊÔ´ÏÞÖÆ

ʹÓÃDocker¿ÉÒÔÀû±ãµØΪÈÝÆ÷·ÖÅɺÍÖÎÀí×ÊÔ´ £¬ÒÔÈ·±£ÈÝÆ÷ÔÚÔËÐÐʱ²»»áÌ«¹ýÕ¼ÓÃϵͳ×ÊÔ´¡£ÒÔÏÂÊÇһЩ³£ÓõÄ×ÊÔ´ÏÞÖÆÒªÁ죺

CPUÏÞÖÆ

¿ÉÒÔʹÓÖcpus²ÎÊýÏÞÖÆÈÝÆ÷¿ÉÒÔʹÓõÄCPU½¹µãÊýÄ¿¡£ÀýÈç £¬ÒÔÏÂʾÀý½«ÏÞÖÆÈÝÆ÷ʹÓÃ×î¶à1¸öCPU½¹µã£º

docker run --cpus=1 mycontainer

µÇ¼ºó¸´ÖÆ

ÄÚ´æÏÞÖÆ

¿ÉÒÔʹÓÖmemory²ÎÊýÏÞÖÆÈÝÆ÷¿ÉÒÔʹÓõÄÄÚ´æ¾Þϸ¡£ÀýÈç £¬ÒÔÏÂʾÀý½«ÏÞÖÆÈÝÆ÷×î¶àʹÓÃ1GBµÄÄڴ棺

docker run --memory=1g mycontainer

µÇ¼ºó¸´ÖÆ

ÍøÂçÏÞÖÆ

¿ÉÒÔʹÓÖnetwork²ÎÊýÏÞÖÆÈÝÆ÷µÄÍøÂç»á¼û¡£ÀýÈç £¬ÒÔÏÂʾÀý½«ÏÞÖÆÈÝÆ÷Ö»ÄÜ»á¼ûÖ¸¶¨µÄÍøÂ磺

docker run --network=my_network mycontainer

µÇ¼ºó¸´ÖÆ

¶þ¡¢ÐÔÄܵ÷ÓÅ

ÔÚÏÖʵʹÓÃÖÐ £¬¶ÔÈÝÆ÷¾ÙÐÐÐÔÄܵ÷ÓÅ¿ÉÒÔÌáÉýÈÝÆ÷µÄÔËÐÐЧÂʺÍÎȹÌÐÔ¡£ÒÔÏÂÊÇһЩ³£ÓõÄÐÔÄܵ÷ÓÅÒªÁ죺

´æ´¢ÐÔÄÜ

DockerÌṩÁ˶àÖÖ´æ´¢Çý¶¯ÀàÐÍ £¬Ñ¡ÔñºÏÊʵĴ洢Çý¶¯¿ÉÒÔÌá¸ßÈÝÆ÷µÄ¶ÁдÐÔÄÜ¡£ÀýÈç £¬ÔÚ½¨ÉèÈÝÆ÷ʱ¿ÉÒÔÖ¸¶¨Ê¹ÓÃoverlay2Çý¶¯£º

docker run --storage-driver=overlay2 mycontainer

µÇ¼ºó¸´ÖÆ

ÍøÂçÐÔÄÜ

ͨ¹ýÉèÖÃDockerµÄÍøÂç²ÎÊý £¬¿ÉÒÔÌáÉýÈÝÆ÷µÄÍøÂçÐÔÄÜ¡£ÀýÈç £¬¿ÉÒÔͨ¹ýÔÚ½¨ÉèÈÝÆ÷ʱָ¶¨–net=host²ÎÊýÀ´Ê¹ÈÝÆ÷ÓëÖ÷»ú¹²ÏíÍøÂç £¬Ìá¸ßÈÝÆ÷µÄÍøÂç´«ÊäËÙÂÊ£º

docker run --net=host mycontainer

µÇ¼ºó¸´ÖÆ

ÈÕÖ¾ÐÔÄÜ

ĬÈÏÇéÐÎÏ £¬Docker½«ÈÝÆ÷µÄÈÕÖ¾Êä³öµ½±ê×¼Êä³ö £¬¿ÉÒÔʹÓÖlog-driver²ÎÊý½«ÈÕÖ¾Êä³öµ½ÆäËûλÖà £¬ÒÔÌá¸ßÈÝÆ÷µÄÈÕÖ¾ÐÔÄÜ¡£ÀýÈç £¬ÒÔÏÂʾÀý½«ÈÝÆ÷µÄÈÕÖ¾Êä³öµ½ÍâµØÎļþ£º

docker run --log-driver=file --log-opt path=/mycontainer/logs/mycontainer.log mycontainer

µÇ¼ºó¸´ÖÆ

Èý¡¢×ÛºÏʾÀý

ÒÔÏÂʾÀýÑÝʾÁËÔõÑùͬʱ¶ÔÈÝÆ÷¾ÙÐÐ×ÊÔ´ÏÞÖƺÍÐÔÄܵ÷ÓÅ£º

docker run --cpus=4 --memory=4g --storage-driver=overlay2 --net=host --log-driver=file --log-opt path=/mycontainer/logs/mycontainer.log mycontainer

µÇ¼ºó¸´ÖÆ

±¾Ê¾ÀýÏÞÖÆÈÝÆ÷×î¶àʹÓÃ4¸öCPU½¹µãºÍ4GBÄÚ´æ £¬Ê¹ÓÃoverlay2Çý¶¯À´Ìá¸ß´æ´¢ÐÔÄÜ £¬ÓëÖ÷»ú¹²ÏíÍøÂçÀ´Ìá¸ßÍøÂçÐÔÄÜ £¬²¢½«ÈÝÆ÷µÄÈÕÖ¾Êä³öµ½ÍâµØÎļþÒÔÌá¸ßÈÕÖ¾ÐÔÄÜ¡£

½áÂÛ£º

ʹÓÃDocker¾ÙÐÐÈÝÆ÷µÄ×ÊÔ´ÏÞÖƺÍÐÔÄܵ÷ÓÅ¿ÉÒÔÌá¸ßÈÝÆ÷µÄÔËÐÐЧÂʺÍÎȹÌÐÔ¡£Í¨¹ýºÏÀíµØ·ÖÅɺÍÏÞÖÆÈÝÆ÷µÄ×ÊԴʹÓà £¬²¢µ÷½âDockerµÄÏà¹Ø²ÎÊý £¬¿ÉÒÔʹÈÝÆ÷ÔÚÔËÐÐʱԽ·¢¸ßЧºÍ¿É¿¿¡£Ï£Íû±¾ÎÄËùÏÈÈݵÄÒªÁìºÍʾÀýÄܹ»Îª¶ÁÕßÔÚʹÓÃDockerʱÌṩһЩ²Î¿¼ºÍ×ÊÖú¡£

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

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

Ïà¹ØÐÂÎÅ

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

13452372176

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

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

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