diff --git a/Dockerfile b/Dockerfile index a37154a..f78cca8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,25 +5,27 @@ # # Pull base image. -FROM dockerfile/python +FROM dockerfile/ubuntu + +# Select the version you want to use +# e.g.: latest, unstable, 0.11.12, 0.10.2, .. +ENV nodeVersion latest + +#Suppress debian frontend errors +ENV DEBIAN_FRONTEND noninteractive -# Install Node.js RUN \ - cd /tmp && \ - wget http://nodejs.org/dist/node-latest.tar.gz && \ - tar xvzf node-latest.tar.gz && \ - rm -f node-latest.tar.gz && \ - cd node-v* && \ - ./configure && \ - CXX="g++ -Wno-unused-local-typedefs" make && \ - CXX="g++ -Wno-unused-local-typedefs" make install && \ - cd /tmp && \ - rm -rf /tmp/node-v* && \ - npm install -g npm && \ - echo -e '\n# Node.js\nexport PATH="node_modules/.bin:$PATH"' >> /root/.bashrc + apt-get update && \ + apt-get install -y npm && \ + ln -sf /usr/bin/nodejs /usr/local/bin/node && \ + apt-get install -y curl && \ + rm -rf /var/lib/apt/lists/* && \ + npm install -g n && \ + n ${nodeVersion} && \ + echo '\n# Node.js\nexport PATH="node_modules/.bin:$PATH"' >> /root/.bashrc # Define working directory. WORKDIR /data # Define default command. -CMD ["bash"] +CMD ["node", "-v"] diff --git a/README.md b/README.md index 9bfea57..2906625 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This repository contains **Dockerfile** of [Node.js](http://nodejs.org/) for [Do ### Base Docker Image -* [dockerfile/python](http://dockerfile.github.io/#/python) +* [dockerfile/ubuntu](http://dockerfile.github.io/#/ubuntu) ### Installation