From e3bcbcc5693f1a00e3c62c6dd1b7d5c2fe6b8373 Mon Sep 17 00:00:00 2001 From: Johannes Schickling Date: Sun, 23 Nov 2014 17:13:01 +0100 Subject: [PATCH] nodejs --- nodejs/Dockerfile | 11 +++++++++++ nodejs/README.md | 11 +++++++++++ nodejs/install.sh | 17 +++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 nodejs/Dockerfile create mode 100644 nodejs/README.md create mode 100644 nodejs/install.sh diff --git a/nodejs/Dockerfile b/nodejs/Dockerfile new file mode 100644 index 0000000..044bd79 --- /dev/null +++ b/nodejs/Dockerfile @@ -0,0 +1,11 @@ +FROM debian:jessie +MAINTAINER Johannes Schickling "schickling.j@gmail.com" + +ENV DEBIAN_FRONTEND noninteractive + +ADD install.sh install.sh +RUN chmod +x install.sh && ./install.sh && rm install.sh + +VOLUME ["/source"] +WORKDIR /source +CMD ["bash"] diff --git a/nodejs/README.md b/nodejs/README.md new file mode 100644 index 0000000..d6b3ec1 --- /dev/null +++ b/nodejs/README.md @@ -0,0 +1,11 @@ +# nodejs + +Minimal NodeJS + NPM image + +## Usage + +```sh +$ docker run --rm -it -v $(pwd):/source schickling/nodejs +``` + +Mount your local source folder to the container and run it inside the container. diff --git a/nodejs/install.sh b/nodejs/install.sh new file mode 100644 index 0000000..01a1eac --- /dev/null +++ b/nodejs/install.sh @@ -0,0 +1,17 @@ +#! /bin/bash + +# exit if a command fails +set -e + +# install node & npm +apt-get update && apt-get install -y nodejs npm + +# alias as node +ln -sf /usr/local/bin/nodejs /usr/local/bin/node + +# cleanup package manager +apt-get autoclean && apt-get clean +rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# prepare dir +mkdir /source