title: Bcrypt: invalid ELF header with Docker and Sails.JS
body: <p>My Node <code>Dockfile</code>:</p>
  
  <pre><code># Set the base image to ubuntu
  FROM ubuntu
  
  # Define working directory
  ADD . /src
  WORKDIR /src
  
  # Install Node.js &amp; other dependencies
  RUN apt-get update &amp;&amp; \
          apt-get -y install curl &amp;&amp; \
          apt-get -y install sudo &amp;&amp; \
          curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash - &amp;&amp; \
          apt-get -y install python build-essential nodejs
  
  RUN npm install -g node-gyp &amp;&amp; \
          node-gyp clean &amp;&amp; \
          npm cache clean
  
  RUN node -v
  
  # Install nodemon
  RUN npm install -g nodemon
  
  
  ADD package.json /src/package.json
  RUN cd /src &amp;&amp; npm install
  
  
  # Expose port
  EXPOSE  8080
  
  # Run app using nodemon
  CMD npm install; nodemon /src/app.js
  </code></pre>
  
  <p>Here is my <code>docker-compose.yml</code>:</p>
  
  <pre><code>nginx:
      build: ./nginx
      links:
          - node1:node1
          - node2:node2
          - node3:node3
      ports:
          - "80:80"
  redis:
      image: redis
      ports:
          - "6379"
  node1:
      build: ./node
      links:
          - redis
      ports:
          - "8080"
  node2:
      build: ./node
      links:
          - redis
      ports:
          - "8080"
  node3:
      build: ./node
      links:
          - redis
      ports:
          - "8080"
  </code></pre>
  
  <p><code>docker-compose build</code> runs successfully and Redis/Nginx setup correcly on <code>docker-compose up</code> but the node instances throw this error:</p>
  
  <pre><code>node2_1 | /src/node_modules/bcrypt/node_modules/bindings/bindings.js:83
  node2_1 |         throw e
  node2_1 |               ^
  node2_1 | Error: /src/node_modules/bcrypt/build/Release/bcrypt_lib.node: invalid ELF header
  node2_1 |     at Error (native)
  node2_1 |     at Module.load (module.js:355:32)
  node2_1 |     at Function.Module._load (module.js:310:12)
  node2_1 |     at Module.require (module.js:365:17)
  node2_1 |     at require (module.js:384:17)
  node2_1 |     at bindings (/src/node_modules/bcrypt/node_modules/bindings/bindings.js:76:44)
  node2_1 |     at Object.&lt;anonymous&gt; (/src/node_modules/bcrypt/bcrypt.js:3:35)
  node2_1 |     at Module._compile (module.js:460:26)
  node2_1 |     at Object.Module._extensions..js (module.js:478:10)
  node2_1 |     at Module.load (module.js:355:32)
  node2_1 |     at Function.Module._load (module.js:310:12)
  node2_1 |     at Module.require (module.js:365:17)
  node2_1 |     at require (module.js:384:17)
  node2_1 |     at Object.&lt;anonymous&gt; (/src/api/models/User.js:10:14)
  node2_1 |     at Module._compile (module.js:460:26)
  node2_1 |     at Object.Module._extensions..js (module.js:478:10)
  node2_1 | 19 Aug 20:21:11 - [nodemon] app crashed - waiting for file changes before starting...
  </code></pre>
  
  <p>I've searched all over and can't seem to find a solution that works. I've tried using the regular setup url: <code>https://deb.nodesource.com/setup</code>, specifically installing <code>python2.7</code>, and using the <code>ubuntu:15.04</code> image.</p>
  
  <p>I've read that this happens when people try to use bcrypt on a linux env after it was built on a OS X (my OS), but I don't think that would be the issue since I'm building everything using docker and boot2docker.</p>