Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample Dockerfile for a image with Node.js installed
# build with: docker build -f Dockerfile -t image_name .
# run with: docker run -it --name container_name image_name /bin/bash
# run exposing ports and sharing volume:
# docker run -it --name container_name -p 8000:8000 --mount type=bind,src=/your/path/to/local/source/code,dst=/src image_name /bin/bash
FROM debian
RUN apt-get update
ENV DEBIAN_FRONTEND noninteractive
RUN apt update -y && apt install vim -y && apt install -y procps
RUN apt-get install -y curl
# Install Node.js PPA
RUN apt-get install -y software-properties-common
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
# Install Node.js
RUN apt-get install -y nodejs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.