I'm trying to get my Sails.js
app up and running using the standard node
Docker image but the build is failing when it tries to npm install bcrypt
.
> bcrypt@0.8.0 install /myapp/node_modules/bcrypt
> node-gyp rebuild
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: node-v0.10.33.tar.gz local checksum 822ba41f2d77b704ab63e244dfef7431b31893c19bfe3bf228c06b6aff063ed5 not match remote 75dc26c33144e6d0dc91cb0d68aaf0570ed0a7e4b0c35f3a7a726b500edd081e
gyp ERR! stack at deref (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:299:20)
gyp ERR! stack at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:340:13)
gyp ERR! stack at IncomingMessage.emit (events.js:117:20)
gyp ERR! stack at _stream_readable.js:943:16
gyp ERR! stack at process._tickCallback (node.js:419:13)
gyp ERR! System Linux 3.16.1-tinycore64
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /pos/node_modules/bcrypt
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
Alternatively sometimes it simply fails as follows:
> bcrypt@0.8.0 install /myapp/node_modules/bcrypt
> node-gyp rebuild
Killed
And sometimes it just hangs indefinitely at
> bcrypt@0.8.0 install /pos/node_modules/bcrypt
> node-gyp rebuild
My Dockerfile
looks like:
FROM node:0.10.33
# copy the source files into the image
ADD . /myapp
# Define working directory.
WORKDIR /myapp
# Install node-gyp as global and ensure it's all clean and tide
RUN npm install -g node-gyp && \
node-gyp clean && \
npm cache clean
# Install project dependencies
RUN npm install
# Expose sails port (still in development mind you)
EXPOSE 1337
# Define default command.
CMD ["node app"]
Things I've tried
- this post in another Stackoverflow thread suggested I should also
RUN apt-get -y install g++
but adding that to myDockerfile
made no difference and it just reports thatg++ is already the newest version.
- this post suggested I ensure
openssl
is installed so I addedRUN apt-get install -y openssl
that that also reportedopenssl is already the newest version
. - I've also tried
RUN apt-get install -y build-essential
but that too reports that it's already the latest version.
I've seen suggestions that Node needs to be installed as a legacy
version, which is something the standard Node image ought to be responsible for, if necessary I believe, so I've also reported this as an issue with the docker-library/node project.
In the meantime, what else ought I try?