这是我想要做的。我想在myApp2启动并运行时运行myApp1。我正在尝试使用wait-for-it.sh,但我似乎无法使其工作。=[请救命!
version: '3'
services:
myApp1:
image: myApp1:latest
ports:
- 40400:40400
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "/var/run/docker.sock:/var/run/docker.sock"
deploy:
mode: replicated
replicas: 1
depends_on:
- "myApp2"
command: ["./wait-for-it.sh", "myApp2:40000"]
myApp2:
image: myApp2:latest
ports:
- 40000:40000
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "/var/run/docker.sock:/var/run/docker.sock
deploy:
mode: replicated
replicas: 1发布于 2021-10-13 07:23:35
您没有指定wait-for-it.sh返回成功后要做什么。尝试:
command: ["./wait-for-it.sh", "myApp2:40000", "-s", "--", "<your program>", "your program arguments if any"]
https://stackoverflow.com/questions/69550733
复制相似问题