![](/img/trans.png)
[英]How to run a shell command on all containers of a replicated docker-compose service?
[英]start multiple docker containers with a single command line shell script (without docker-compose)
我有3個將在單個服務器上運行的容器,我們將其稱為:A,B,C
每個服務器在主機上都有一個腳本,該腳本具有啟動docker的命令:
A_start.sh
B_start.sh
C_start.sh
我正在嘗試創建一個群體腳本來啟動它們,但不確定如何。
ABC_start.sh
更新:這似乎可行,因為第一個輸出到終端,cntrl + C退出了所有這些。
./A_start.sh & ./B_start.sh & ./C_start.sh
docker-compose
,它的主要目的是正確鏈接容器並啟動它們,因此腳本集合最終可能只是一個docker-compose up
命令。 猛烈地
你可以這樣做:
nohup A_start.sh &
nohup B_start.sh &
nohup C_start.sh &
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.