Skip to content

Instantly share code, notes, and snippets.

@FlaviaBastos
Created October 10, 2020 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FlaviaBastos/6ecb85b7605031d49bde81130b51fb45 to your computer and use it in GitHub Desktop.
Save FlaviaBastos/6ecb85b7605031d49bde81130b51fb45 to your computer and use it in GitHub Desktop.
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