Skip to content

Instantly share code, notes, and snippets.

@Wei1234c
Last active September 4, 2015 02:02
Show Gist options
  • Save Wei1234c/6d7a4d313edfdf1187ca to your computer and use it in GitHub Desktop.
Save Wei1234c/6d7a4d313edfdf1187ca to your computer and use it in GitHub Desktop.
NodeJS dockerfile
# Node.js Dockerfile
# https://github.com/dockerfile/nodejs
#
# origin: https://github.com/dockerfile/nodejs
# modified by: Wei Lin
# date: 2015/9/3
# Pull base image.
FROM python
MAINTAINER Wei Lin
ENV TERM linux
# Install Node.js
RUN apt-get update && apt-get install -y wget && \
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 && \
printf '\n# Node.js\nexport PATH="node_modules/.bin:$PATH"' >> /root/.bashrc
# Upgrade and clean up
RUN apt-get dist-upgrade -y && \
apt-get remove wget -y && \
apt-get autoremove -y && \
apt-get autoclean -y && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
# Define working directory.
WORKDIR /data
# Define default command.
CMD ["bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment