my dockerfile conf:
FROM ubuntu:16.04
MAINTAINER S.K.
RUN apt-get update
RUN apt-get install curl -y
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
RUN export NVM_DIR="$HOME/.nvm"
RUN [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
RUN nvm install node
RUN nvm use 6.9.1
RUN npm i express -g
RUN npm i nunjucks -g
RUN npm i nodemon -g
RUN mkdir -p PROJECT
VOLUME /PROJECT/
EXPOSE 1520
In the step RUN [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
Im get error:
The command '/bin/sh -c [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"' returned a non-zero code: 1
Everybody knows how I can fix it ?
I solved my problem ! Thanks for all, who tried to help me ! After each command (RUN, CMD and else) Docker makes container, save changes on docker image and delete container before next command.Docker also compress directories and files each command iteration. You should know it before do anything, if you don't want to get an exception or error..
This is working code :
FROM ubuntu:16.04
MAINTAINER S.K.
RUN apt-get update
RUN apt-get install curl -y
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash \
&& export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" \
&& nvm install 6.9.1 \
&& npm i express -g \
&& npm i nunjucks -g \
&& npm i nodemon -g \
&& npm i gulp -g \
RUN mkdir -p ./PROJECT
EXPOSE 1520
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With