Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save x-yuri/7e7db914a061c7dc49024bca750c8b8b to your computer and use it in GitHub Desktop.
Save x-yuri/7e7db914a061c7dc49024bca750c8b8b to your computer and use it in GitHub Desktop.
Chromium DevTools and docker -p 127.0.0.1:9229:9229

Chromium DevTools and docker -p 127.0.0.1:9229:9229

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment