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

dockerÔõô²éÇéÐαäÁ¿

ÔõÑùÉó²é docker ÈÝÆ÷ÖеÄÇéÐαäÁ¿

Docker ÈÝÆ÷ÊÇÒ»ÖÖÇáÁ¿¼¶µÄÐéÄâÇéÐΣ¬ÓÃÓÚ¸ôÀëºÍ´ò°üÓ¦ÓóÌÐò¼°ÒÀÀµÏî¡£ËüÌṩÁËһϵÁÐÇéÐαäÁ¿£¬ÓÃÓÚÉèÖúͿØÖÆÈÝÆ÷µÄÔËÐÐʱÐÐΪ¡£

ÒªÉó²é Docker ÈÝÆ÷ÖеÄÇéÐαäÁ¿£¬¿ÉÒÔʹÓÃÒÔÏ°취£º

1. »ñÈ¡ÈÝÆ÷ ID

docker ps -a

µÇ¼ºó¸´ÖÆ

´ËÏÂÁÁгöËùÓÐÕýÔÚÔËÐкÍÒÑ×èÖ¹µÄÈÝÆ÷¡£ÕÒµ½Òª¼ì²éµÄÇéÐαäÁ¿µÄÈÝÆ÷ ID¡£

2. Éó²éÇéÐαäÁ¿

¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÉó²éÈÝÆ÷µÄÇéÐαäÁ¿£º

docker inspect -f '{{json .Config.Env}}' <container-id></container-id>

µÇ¼ºó¸´ÖÆ

ÆäÖÐ ÊÇ°ì·¨ 1 ÖлñµÃµÄÈÝÆ÷ ID¡£

´ËÏÂÁÊä³öÒ»¸ö JSON ¹¤¾ß£¬ÆäÖаüÀ¨ÈÝÆ÷µÄÇéÐαäÁ¿Áбí¡£JSON ¹¤¾ßµÄÃûÌÃÈçÏ£º

[
  "KEY1=VALUE1",
  "KEY2=VALUE2",
  ...
]

µÇ¼ºó¸´ÖÆ

ÆäÖÐ KEY ÊÇÇéÐαäÁ¿µÄÃû³Æ£¬VALUE ÊÇÆäÖµ¡£

ʾÀý

ÀýÈ磬ҪÉó²éÃûΪ “my-container” µÄÈÝÆ÷ÖеÄÇéÐαäÁ¿£¬¿ÉÒÔÔËÐÐÒÔÏÂÏÂÁ

docker inspect -f '{{json .Config.Env}}' my-container

µÇ¼ºó¸´ÖÆ

Õ⽫Êä³öÒ»¸öÀàËÆÓÚÒÔÏÂÄÚÈÝµÄ JSON ¹¤¾ß£º

[
  "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
  "USER=my-user",
  ...
]

µÇ¼ºó¸´ÖÆ

ÒÔÉϾÍÊÇdockerÔõô²éÇéÐαäÁ¿µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

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

18523999891

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

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

QR code
ÍøÕ¾µØͼ