Create Docker Container from Dockerfile

$ docker pull node


$ docker image ls | grep node


$ mkdir -p ~/dockerfiles
$ cd ~/dockerfiles


$ vi nodejs.dockerfile


1
2
3
4
5
6
7
8
9
10
11
12
13
14
FROM node:latest

RUN apt-get update && apt-get install -qq -y vim git curl net-tools

ENV PROJECT_PATH /project
RUN mkdir -p $PROJECT_PATH
RUN mkdir -p /usr/local/lib/node_modules/
RUN npm install -g [email protected] [email protected]

WORKDIR $PROJECT_PATH


USER root
CMD ["bash"]


$ docker build -f nodejs.dockerfile -t marley/nodejs .


$ docker image ls | grep marley/nodejs
marley/nodejs               latest              798c422b32ac        41 seconds ago      717MB