Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Dockerize #10

Open
hsingh6764 opened this issue Apr 4, 2018 · 2 comments
Open

Dockerize #10

hsingh6764 opened this issue Apr 4, 2018 · 2 comments

Comments

@hsingh6764
Copy link

This could be really useful Auth0 Proxy that some one can just use.

@hsingh6764
Copy link
Author

hsingh6764 commented Apr 4, 2018

FROM node

WORKDIR /opt/code

COPY package.json package-lock.json ./
RUN npm install
COPY . .

CMD ["npm", "start"]

@sdanbury
Copy link

Word of warning, if you upgrade npm in the Dockerfile as root like so...

RUN npm i npm@latest -g && npm install

... you may come across the following error:

Error: could not get uid/gid
[ 'nobody', 0 ]

    at /usr/local/lib/node_modules/npm/node_modules/uid-number/uid-number.js:37:16
    at ChildProcess.exithandler (child_process.js:289:5)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:957:16)
    at Socket.stream.socket.on (internal/child_process.js:378:11)
    at Socket.emit (events.js:182:13)
    at Pipe._handle.close [as _onclose] (net.js:598:12)
TypeError: Cannot read property 'get' of undefined
    at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205:18)
    at /usr/local/lib/node_modules/npm/bin/npm-cli.js:83:20
    at cb (/usr/local/lib/node_modules/npm/lib/npm.js:224:22)
    at /usr/local/lib/node_modules/npm/lib/npm.js:262:24
    at /usr/local/lib/node_modules/npm/lib/config/core.js:81:7
    at Array.forEach (<anonymous>)
    at /usr/local/lib/node_modules/npm/lib/config/core.js:80:13
    at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)
    at afterExtras (/usr/local/lib/node_modules/npm/lib/config/core.js:178:20)
    at Conf.<anonymous> (/usr/local/lib/node_modules/npm/lib/config/core.js:236:22)
    at /usr/local/lib/node_modules/npm/node_modules/uid-number/uid-number.js:39:14
    at ChildProcess.exithandler (child_process.js:289:5)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:957:16)
    at Socket.stream.socket.on (internal/child_process.js:378:11)
    at Socket.emit (events.js:182:13)
/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205
  if (npm.config.get('json')) {
                 ^

TypeError: Cannot read property 'get' of undefined
    at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:205:18)
    at process.emit (events.js:182:13)
    at process._fatalException (internal/bootstrap/node.js:436:27)

Which can be fixed by running as non root, or by also adding the following command (although I wouldn't really recommend it):

npm config set unsafe-perm true

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants