Skip to content
This repository was archived by the owner on May 15, 2019. It is now read-only.
This repository was archived by the owner on May 15, 2019. It is now read-only.

The port generate with functions inspect helloWorld it's not exposed correctly from the Docker container: #325

@nietzscheson

Description

@nietzscheson

I have created this docker-compose environment for more information:

Environment details

  • OS: MacOS Mojave 10.14.1
  • Docker for Mac:
    • docker: 18.09.2, build 6247962
    • docker-compose: 1.23.2, build 1110ad01
  • Node.js version (docker image): node:8.14.0-alpine
  • npm version: 6.4.1
  • yarn version: 1.12.3
  • @google-cloud/functions-emulator version: 1.0.0-beta.6

Steps to reproduce

  1. First, run firebase serve in functions (docker-compose run firebase with the node command image: yarn --cwd functions serve):
firebase serve --only functions -o 0.0.0.0 --port 8010
  1. To debug run:
functions deploy helloWorld -S functions -H
functions start --bindHost 0.0.0.0 --host 0.0.0.0
functions inspect helloWorld --host 0.0.0.0

The result:

Debugger for helloWorld listening on port 9229.
  1. When I trying open http://0.0.0.0:9229/json, this not works: This page isn’t working

Trying to avoid suspicion of whether the node --inspect does not work correctly, I expose port 9228 and exec the container: docker-compose exec node sh. I am going to functions: cd functions and I run the node inspector: node --inspect-brk = 0.0.0.0: 9228 index.js.

Now, when I trying open http://0.0.0.0:9228/json, this works:

[ {
  "description": "node.js instance",
  "devtoolsFrontendUrl": "chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=192.168.112.2:9228/b63b7903-7f2c-4304-ba02-63473ddffe90",
  "faviconUrl": "https://nodejs.org/static/favicon.ico",
  "id": "b63b7903-7f2c-4304-ba02-63473ddffe90",
  "title": "index.js",
  "type": "node",
  "url": "file:///app/functions/index.js",
  "webSocketDebuggerUrl": "ws://192.168.112.2:9228/b63b7903-7f2c-4304-ba02-63473ddffe90"
} ]

I really do not know what may be happening. The documentation is null. I have not found anything related. The information that there is to debug from a Docker container does not work for me. Any solution I will be grateful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions