Wednesday, 15 March 2017

Docker with node bcrypt — invalid ELF header

I've tried every solution from this post and this post

I'm not finding a solution to get rid of the following error when running docker-compose up:

module.js:598
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: /code/node_modules/bcrypt/lib/binding/bcrypt_lib.node: invalid ELF header

Here's my latest attempt docker-compose.yml

version: "2"

services:
  app:
    build: ./client
    ports:
      - "3000:3000"
    links:
      - auth
    volumes:
      - ./client:/code
  auth:
    build: ./auth-service
    ports:
      - "3002:3002"
    links:
      - db
    volumes:
      - ./auth-service:/code
  db:
    ...

And my auth service Dockerfile:

FROM node:7.7.1

EXPOSE 3002

WORKDIR /code

COPY package.json /code

RUN npm install

COPY . /code

CMD npm start

After trying each of the solution from the above two links, I rebuild the containers and it always results in the same error.

Also worth noting, the service runs fine locally, when I don't use docker.

How do I get docker to work with bcrypt?



via Scott

No comments:

Post a Comment