NodeJS Container, Ubuntu based, use any NodeJS Version via environment variable over NVM
3.0K
maintained by MarvAmBass
FAQ - All you need to know about the marvambass Containers
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
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.
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.
Content type
Image
Digest
sha256:d83675558…
Size
111.6 MB
Last updated
about 11 years ago
docker pull marvambass/nodejs