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

"Could not kill process on port" in Alpine based docker images (fix suggestion) #9

Open
FedericoBiccheddu opened this issue May 15, 2018 · 0 comments

Comments

@FedericoBiccheddu
Copy link

FedericoBiccheddu commented May 15, 2018

Using this package in order to solve a problem with Node.js --inspect in the official alpine docker image, I receive that error message.

I solved this problem using the following command:
netstat -lnpt | awk '$4 ~ /:PORT$/ {sub(/\/.*/, "", $7); print $7}'
but i don't know if can be used in other circumstances.

EDIT: another solution compatible with npm/yarn scripts is:
netstat -lnpt | awk '$4 ~ /:PORT$/ {print $7}' | cut -d'/' -f1
so can be used like:

{
  "scripts": {
    "dev:inspect:port": "netstat -lnpt | awk '$4 ~ /:PORT$/' | awk '{print $7}' | cut -d'/' -f1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants