LuckyCoder
LuckyCoder

Reputation: 520

Docker & SailsJS

I'm trying to run a sails app using docker. But docker building was failing. Here is the content of Dockerfile.

FROM nodesource/jessie:6.2

RUN apt-get update
RUN apt-get -y install wget
RUN apt-get -y install curl
RUN apt-get -y install nano
RUN apt-get -y install tree
RUN apt-get -y install tmux
RUN npm install [email protected] -g

# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

# Install app dependencies
COPY package.json /usr/src/app/
RUN npm install

EXPOSE 1337
ENV NODE_ENV production
ENV PORT 80

CMD ["npm","start"]

I tried using different node versions like 4.4, 5.2, 6.2 etc. And always failing in same point, sails installation.

Error code was

Step 8 : RUN npm install [email protected] -g
 ---> Running in b225cdb580fd
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated [email protected]: DEPRECATED. See readme: https://github.com/gruntjs/grunt-lib-contrib
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead!
npm WARN deprecated [email protected]: 'native-or-bluebird' is deprecated. Please use 'any-promise' instead.
Killed
The command '/bin/sh -c npm install [email protected] -g' returned a non-zero code: 137

Do you guys have any idea to fix this issue? Thanks

Upvotes: 0

Views: 1169

Answers (1)

t6nand
t6nand

Reputation: 780

As per error log, you can try either to use latest distribution of sailsJS, or if it's necessary for you to use the version specified try to build your docker image using older versions of nodeJS. Check the node version with which this intended version works successfully and add it to your Dockerfile.

Also try to club your RUN commands in Dockerfile. It will help you reduce your size of Docker image.

Upvotes: 1

Related Questions