Bcrypt: invalid ELF header with Docker and Sails.JS

后端 未结 7 2005
被撕碎了的回忆
被撕碎了的回忆 2021-01-02 02:41

My Node Dockfile:

# Set the base image to ubuntu
FROM ubuntu

# Define working directory
ADD . /src
WORKDIR /src

# Install Node.js & other          


        
7条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-02 03:12

    I have found that excluding the entire local node_modules directory does not allow you to install npm packages and have your docker container track those changes in the container on the fly. I will have to rebuild my container each time. To avoid this specify only the bcrypt directory in the container volume and allow docker to track changes when other packages are installed or removed:

    volumes: 
      - .:/app
      - /app/node_modules/bcrypt/
    

提交回复
热议问题