我知道在碼頭集裝箱中使用多個終端是很奇怪的。Ahow在Docker容器中使用多個終端?
我的目的是測試一些命令並最終用這些命令建立一個dockerfile。 所以我需要使用多個終端,比如兩個。一個是運行一些命令,另一個是用來測試命令。
如果我使用真機,我可以ssh使用多個終端,但是在docker中,我該怎麼做?
也許解決的辦法是將run
碼頭與CMD /bin/bash
,並在該bash中,使用screen
?
編輯 In my situation, one shell run a server program, the other run a client program to test the server program. Because the server program and client program are compiled together. So, the default link method in docker is not suitable.
不知道我明白。你需要多一個shell?像一個運行命令,第二個運行尾部日誌? – michaelbn 2014-09-29 09:56:27
類似的東西,一個shell運行一個服務器程序,另一個運行一個客戶端程序來測試服務器程序。 – HaveF 2014-09-29 10:23:28