Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very odd Windows behavior #602

Closed
nitinthewiz opened this issue Dec 7, 2020 · 2 comments
Closed

Very odd Windows behavior #602

nitinthewiz opened this issue Dec 7, 2020 · 2 comments
Labels

Comments

@nitinthewiz
Copy link

Folks,

I'm testing the default docker.run promise example and on Windows, I observed some very odd behavior - after the script runs, the program just doesn't stop!

docker.run(testImage, ['bash', '-c', 'uname -a'], process.stdout).then(function(data) {
  var output = data[0];
  var container = data[1];
  console.log(output.StatusCode);
  return container.remove();
}).then(function(data) {
  console.log('container removed');
}).catch(function(err) {
  console.log(err);
});

I thought it's something odd with the stream, or stdout, so I tried stream.end, and process.stdout.end() and even process.exit(), but none of them stop the program.

If I run the same code on Mac, the program ends gracefully after printing the output.StatusCode of zero. But on Windows, it still prints the zero and then just... sits there...

Am I going mad? Is there some reason process.exit wouldn't work on Windows?

I tried the following on Windows -

docker.run(testImage, ['bash', '-c', 'uname -a'], process.stdout).then(function(data) {
  var output = data[0];
  var container = data[1];
  console.log(output.StatusCode);
  return container.remove();
}).then(function(data) {
  console.log('container removed');
  process.exit();
}).catch(function(err) {
  console.log(err);
});

Windows 10 Pro, Docker is running with WSL2. By the way, the docker container exits gracefully on container remove. Kudos on the awesome library!

@nitinthewiz
Copy link
Author

I sense this is linked to #534

@stale
Copy link

stale bot commented Jun 10, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Open a new issue if needed.

@stale stale bot added the stale label Jun 10, 2022
@stale stale bot closed this as completed Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant