I am quite new to docker so I ran into some error state with my python script. It should listen for a couple of docker containers which have been started with docker-compose up using a specific yaml file.
The ignition process is working but when one container goes down another one (observing entity) should revive it with, say docker-compose start deadmodule
My setup:
I am trying this:
subprocess.call('docker-compose',
'start',
'deadmodule')
And I tried it also with Popen(['docker-compose', 'start', 'deadmodule'], stdout=PIPE, stderr=PIPE)
However it ends with this:
FileNotFoundError: [Errno 2] No such file or directory: 'docker-compose': 'docker-compose'
当您不使用shell=True
,不会自动添加文件结尾,因此您需要调用的是docker-compose.exe
,而不是docker-compose.exe
docker-compose
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.