Since around node >= 14.21.3
(Alpine Linux 3.14) you need to run docker
containers with -p 127.0.0.1:9229:9229
, not with -p 9229:9229
. Or else Chromium DevTools won't see the debugger (server).
With node 14.20.1
(Alpine Linux 3.13) it works both ways.
$ docker run --rm -itp 127.0.0.1:9229:9229 alpine:3.14
$ docker run --rm -itp 9229:9229 alpine:3.14
$ docker run --rm -itp 127.0.0.1:9229:9229 alpine:3.13
$ docker run --rm -itp 9229:9229 alpine:3.13
/ # apk add nodejs
/ # echo 'console.log("a")' > a.js
/ # node --inspect-brk=0.0.0.0 a.js