docker-compose: the down method doesn't appear to work
After having run the following command:
await compose.upAll(composeOpts)
I run the following command:
await this.compose.down(composeOpts)
and he enclosing promise simply dies. I have wrapped this code in a try and it doesn’t catch any error. The execution just stops.
Is there an example of down being used somewhere? I can’t find any documentation on down or stop, and I am unable to manage my containers after creating them with this package.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 2
- Comments: 15 (8 by maintainers)
Technically this should not change much,
awaitis basically aGeneratorwrapper around.thenand.catchcalls. Since.thenreturns aPromise, it should work exactly as we expect here.I’ve looked it up and apparently you can’t do that (attach the streams) atm. That’s because https://github.com/PDMLab/docker-compose/blob/dd4fe76eab0eddb273f5f4dc9981408588166095/src/index.ts#L167-L170 doesn’t allow passing other options to the spawned process 😕 I kinda assumed it was possible.
See
child_process.spawnreference: https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_optionsWe’re looking for
stdiooption.I’ll have a look if we can patch this after work.
@Steveb-p the process doesn’t hang, it just “exits” that async method, almost as if the promise resolved, and continues executing the lines after “bringItDown” is called.
@AlexZeitler I cloned anew, yarn install and yarn test, and now the tests are being found and completed successfully. I will try to use the tests here to narrow down the cause of my issue.