Public | Automated Build

Last pushed: 2 years ago
Short Description
NodeJS Container, Ubuntu based, use any NodeJS Version via environment variable over NVM
Full Description

Docker NodeJS Container (marvambass/nodejs)

maintained by MarvAmBass

FAQ - All you need to know about the marvambass Containers

What is it

This Dockerfile (available as marvambass/nodejs) gives you a NodeJS Container, where you can specify the NodeJS Version you want to use.
By default it uses the current stable Version.

To configure the Container you use environment Variables.

It's based on the ubuntu:14.04 Image

View in Docker Registry marvambass/nodejs

View in GitHub MarvAmBass/docker-nodejs

Environment variables and defaults

NodeJS Version

  • NODE_Version
    • optional - if not set, the container uses the stable version it downloaded at container build
    • set this to any NodeJS Version supported by creationix/nvm for example 'NODE_VERSION=v0.10.0'
    • there is also something special here, if you want the absolutly current version of the current time, you can use 'NODE_VERSION=stable' and the current stable version will be downloaded

Usage

This container is made to be your Base Image, so the best way to use it is to build your own Dockerfile on top of it.

The Container uses creationix/nvm as NodeJS Version Manager, so you're free to use any Version available there.

You should'nt overwrite the ENTRYPOINT because then you're no longer able to use my Environment Variable settings.

You are also able to execute Dockers CMD as usual, as my ENTRYPOINT script is a passthru for /bin/bash.

Examples

The simples way:

FROM marvambass/nodejs
RUN wget http://example.js/nodejs-server.js -O /server.js
EXPOSE 4000
CMD node /server.js

If you want to use a specific NodeJS Version

FROM marvambass/nodejs
ENV NODE_VERSION v0.10.0
RUN wget http://example.js/nodejs-server.js -O /server.js
EXPOSE 4000
CMD node /server.js

Get a BASH inside marvambass/nodejs or inheriting containers

docker run -ti marvambass/nodejs /bin/bash
>> exec docker CMD
/bin/bash
root@006900a8d48c:/# node -v
v0.10.35
root@006900a8d48c:/# 

You also can check my containers who use marvambass/nodejs - so you get a better look on how to use this container.

Docker Pull Command
Owner
marvambass
Source Repository