now npm and node are properly set
This commit is contained in:
parent
b3bfb0d042
commit
0bf796ff58
44
Dockerfile
44
Dockerfile
@ -1,20 +1,36 @@
|
|||||||
FROM debian
|
FROM debian
|
||||||
|
|
||||||
# Install prerequirements or NVM
|
# Replace shell with bash so we can source files
|
||||||
RUN apt-get update \
|
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
|
||||||
&& apt-get install -y \
|
|
||||||
curl \
|
# Set debconf to run non-interactively
|
||||||
|
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
|
||||||
|
|
||||||
|
# Install base dependencies
|
||||||
|
RUN apt-get update && apt-get install -y -q --no-install-recommends \
|
||||||
|
apt-transport-https \
|
||||||
build-essential \
|
build-essential \
|
||||||
python
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
git \
|
||||||
|
libssl-dev \
|
||||||
|
python \
|
||||||
|
rsync \
|
||||||
|
software-properties-common \
|
||||||
|
wget \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Install NVM with node
|
ENV NVM_DIR /usr/local/nvm
|
||||||
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.1/install.sh | NVM_DIR="/nvm" bash \
|
ENV NODE_VERSION 4.3.1
|
||||||
&& bash -c "source /nvm/nvm.sh \
|
|
||||||
&& nvm install 4.3.1 \
|
|
||||||
&& nvm alias default v4.3.1"
|
|
||||||
|
|
||||||
ADD .bashrc /.bashrc
|
# Install nvm with node and npm
|
||||||
|
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash \
|
||||||
|
&& source $NVM_DIR/nvm.sh \
|
||||||
|
&& nvm install $NODE_VERSION \
|
||||||
|
&& nvm alias default $NODE_VERSION \
|
||||||
|
&& nvm use default
|
||||||
|
|
||||||
ENV BASH_ENV /.bashrc
|
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
|
||||||
|
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
|
||||||
RUN ln -snf /bin/bash /bin/sh
|
RUN node -v
|
||||||
|
RUN npm -v
|
Loading…
Reference in New Issue
Block a user