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

dockerÔõô½øÈëÈÝÆ÷Ŀ¼

½øÈë docker ÈÝÆ÷Ŀ¼µÄÒªÁ죺ʹÓà docker exec ÏÂÁîʹÓà docker attach ÏÂÁîʹÓà docker run ÏÂÁîʹÓà docker cp ÏÂÁî

ÔõÑù½øÈë Docker ÈÝÆ÷Ŀ¼

µ±ÄãÐèÒª»á¼û Docker ÈÝÆ÷ÄÚµÄĿ¼ʱ £¬¿ÉÒÔʹÓÃÒÔÏÂÒªÁ죺

1. ʹÓà Docker exec ÏÂÁî

ÕâÊǽøÈëÈÝÆ÷µÄ×î³£¼ûÒªÁ죺

docker exec -it  /bin/bash

µÇ¼ºó¸´ÖÆ

ÀýÈç £¬Òª½øÈëÃûΪ “my-container” µÄÈÝÆ÷ £¬ÇëÔËÐУº

docker exec -it my-container /bin/bash

µÇ¼ºó¸´ÖÆ

2. ʹÓà Docker attach ÏÂÁî

Õâ»á½«Ä㸽¼Óµ½ÈÝÆ÷µÄ±ê×¼ÊäÈë¡¢Êä³öºÍ¹ýʧÁ÷£º

docker attach 

µÇ¼ºó¸´ÖÆ

ÀýÈç £¬Òª¸½¼Óµ½ “my-container” ÈÝÆ÷ £¬ÇëÔËÐУº

docker attach my-container

µÇ¼ºó¸´ÖÆ

3. ʹÓà Docker run ÏÂÁî

Õ⽫ÔËÐÐÒ»¸öеÄÈÝÆ÷ £¬²¢ÔÊÐíÄãÖ¸¶¨Òª¹ÒÔصÄÖ÷»úĿ¼£º

docker run --rm -ti -v :/container/directory  /bin/bash

µÇ¼ºó¸´ÖÆ

ÀýÈç £¬Òª½«ÍâµØĿ¼ “/my/local/directory” ¹ÒÔص½ÈÝÆ÷ÄÚµÄ “/container/directory” £¬ÇëÔËÐУº

docker run --rm -ti -v /my/local/directory:/container/directory my-image /bin/bash

µÇ¼ºó¸´ÖÆ

4. ʹÓà Docker cp ÏÂÁî

ÕâÔÊÐíÄ㽫Îļþ»òĿ¼´ÓÈÝÆ÷¸´ÖƵ½Ö÷»ú»ò´ÓÖ÷»ú¸´ÖƵ½ÈÝÆ÷£º

docker cp : 

µÇ¼ºó¸´ÖÆ

ÀýÈç £¬Òª½«ÈÝÆ÷ÖÐµÄ “/container/file.txt” Îļþ¸´ÖƵ½Ö÷»úÉ쵀 “/my/local/file.txt” £¬ÇëÔËÐУº

docker cp my-container:/container/file.txt /my/local/file.txt

µÇ¼ºó¸´ÖÆ

ÒÔÉϾÍÊÇdockerÔõô½øÈëÈÝÆ÷Ŀ¼µÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

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

18523999891

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

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

QR code
ÍøÕ¾µØͼ