Bcrypt: invalid ELF header with Docker and Sails.JS

后端 未结 7 1931
被撕碎了的回忆
被撕碎了的回忆 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:14

    Make sure that you are not copying the node_modules folder. I got this error when using the official nodejs "onbuild" image which would copy everything...

    Now I use:

    .dockerignore

    node_modules
    

    dockerfile

    FROM node:6.4.0
    
    RUN mkdir -p /usr/src/app
    WORKDIR /usr/src/app
    
    COPY package.json /usr/src/app/
    RUN npm install
    COPY . /usr/src/app
    
    CMD [ "npm", "start" ]
    
    EXPOSE 6969
    

    Edit: The official NodeJS Docker starter image project on Github has accepted my pull request for ther README which instructs to explicitly ignore the node_modules.

    0 讨论(0)
提交回复
热议问题