funretro/distributed

Segfaults on start when run in Docker

gramster opened this issue · 6 comments

Expected Behavior

It should not crash.

Actual Behavior

Segfaults on start:

[23:58:00] Using gulpfile /distributed/gulpfile.js
[23:58:00] Starting 'bundle'...
[23:58:00] Finished 'bundle' after 32 ms
[23:58:00] Starting 'copy'...
[23:58:00] Finished 'copy' after 8.66 ms
[23:58:00] Starting 'express'...
[23:58:00] Finished 'express' after 6.72 ms
[23:58:00] Starting 'livereload'...
[23:58:00] Finished 'livereload' after 30 ms
[23:58:00] Starting 'watch'... 
App running and listening on port 4000
Segmentation fault

This is in a docker container on Alpine linux. Dockerfile is:

FROM alpine
RUN apk --no-cache --update-cache add nodejs-npm
COPY distributed /distributed/
RUN cd /distributed && npm install gulp-cli -g && npm install gulp -D && touch gulpfile.js && npm install
EXPOSE 4000 
WORKDIR /distributed
ENTRYPOINT ["gulp"]

I tried a Docker base image that already had node and gulp rather than doing the install myself, but had the same result.

This may not be a distributed bug but I'm not sure how to chase it down; my node skillz are very rusty.

Some more info; I tried Ubuntu instead of Alpine, and it gives more info:

App running and listening on port 4000

events.js:141
      throw er; // Unhandled 'error' event
   ^
TypeError: this is not a typed array.
   at Function.from (native)
   at /distributed/node_modules/gulp-autoprefixer/index.js:25:27
   at run (/distributed/node_modules/core-js/modules/es6.promise.js:66:22)
   at /distributed/node_modules/core-js/modules/es6.promise.js:79:30
   at flush (/distributed/node_modules/core-js/modules/_microtask.js:18:9)
   at nextTickCallbackWith0Args (node.js:419:9)
   at process._tickCallback (node.js:348:13)

With some tweaking of the Dockerfile, I finally have it starting up. I get an endless spinner when I try to create a new board but that's a different issue so closing this.

@gramster hey gramster where are you saving this docker image? Do you think this is something you could share with more people? Is it possible to upload to github?

The endless spinner came from Firebase; I had to enable email/password auth for the project. So it seems to be working now although I see some errors in the JS console.

Right now the docker image has my Firebase details in it; I can look at splitting those out and publishing the image. I'll share the Dockerfile at least once I am back at work.

Yeah I need to update that on README.md to inform people about enabling the email/password configuration. Good catch.

I was thinking about creating an oficial Funretro repository with the docker configuration. I can add you on this repository as well if you want. What do you think?

Makes sense. For now, here is the Dockerfile I used:

FROM node
MAINTAINER Graham Wheeler

RUN apt-get update && apt-get install -y ruby-dev build-essential
RUN npm install -g gulp
RUN npm install gulp gulp-cli

COPY distributed /distributed/
RUN cd /distributed && npm install
EXPOSE 4000
WORKDIR /distributed
ENTRYPOINT ["gulp"]