node.JS application in docker container

I have my node.JS application running in a docker container. While most of the functioning of this setup is normal but it fails to work with kafka-node module. Exception thrown is

        throw e
Error: Module did not self-register.
    at Error (native)
    at Object.Module._extensions..node (module.js:434:18)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at bindings (/app/node_modules/kafka-node/node_modules/snappy/node_modules/bindings/bindings.js:76:44)
    at Object.<anonymous> (/app/node_modules/kafka-node/node_modules/snappy/snappy.js:2:34)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

My Dockerfile is as follows

  • link command hangs when linking container to itself
  • Can I access the host (OS X) filesystem from the boot2docker VM?
  • How to get the service IP in Kubernetes?
  • Does docker reuse images when multiple containers run on the same host?
  • Docker & Angular 2 : binded directory remains empty
  • How to reach additional containers by the hostname after docker-compose scale?
  • FROM node:4
    RUN mkdir -p /app
    WORKDIR /app
    COPY package.json /app/package.json
    RUN npm cache clean
    RUN npm install
    RUN npm rebuild
    COPY . /app
    EXPOSE 8085
    CMD []
    ENTRYPOINT ["bash", ""]

    And for further information, Kafka is running on separate server. All relevant ports are opened and I can telnet successfully for checking them.

  • Simpliest Dockerfile ever to untar: file not found
  • From a container running on Docker for Windows, how can I access a port on the host?
  • What is the purpose of running a django application in a virtualenv inside a docker container?
  • How to run an application inside docker safely
  • Docker env missing with fabric8
  • Xdebug (inside Docker container) ignoring XDEBUG_CONFIG environment variable
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.