Difference between revisions of "Docker Image for developing"
From ESS-WIKI
Eric.liang (talk | contribs) (Created page with "=Setup a Docker Image for developing NodeJS RESTfful API= mkdir a folder ex: EISRestfulAPI git clone https://github.com/ericliang12345/EISRestfulAPI_Dockerfile.git sudo doc...") |
Eric.liang (talk | contribs) |
||
Line 1: | Line 1: | ||
− | =Setup a Docker Image for developing NodeJS RESTfful API= | + | = Setup a Docker Image for developing NodeJS RESTfful API = |
+ | |||
mkdir a folder ex: EISRestfulAPI | mkdir a folder ex: EISRestfulAPI | ||
− | git clone https://github.com/ericliang12345/EISRestfulAPI_Dockerfile.git | + | git clone [https://github.com/ericliang12345/EISRestfulAPI_Dockerfile.git https://github.com/ericliang12345/EISRestfulAPI_Dockerfile.git] |
sudo docker build -t eis/restapi_dev . | sudo docker build -t eis/restapi_dev . | ||
− | =Run a Docker Container= | + | = Run a Docker Container = |
+ | |||
sudo docker run -it --name eis_api_dev -v $PWD:/home/adv:rw -p 3000:3000 eis/restapi_dev /bin/bash </br> | sudo docker run -it --name eis_api_dev -v $PWD:/home/adv:rw -p 3000:3000 eis/restapi_dev /bin/bash </br> | ||
− | -v : share your local foder with container | + | -v : share your local foder with container |
− | -p : port mapping internal / external port | + | -p : port mapping internal / external port |
-name: container name | -name: container name | ||
− | eis/restapi: image | + | eis/restapi: image</br> |
+ | |||
+ | = Check Version of NPM & NodeJS= | ||
+ | $nodejs -v | ||
+ | v4.6.0 | ||
+ | $npm -v | ||
+ | 2.15.9 |
Revision as of 02:56, 11 October 2016
Setup a Docker Image for developing NodeJS RESTfful API
mkdir a folder ex: EISRestfulAPI git clone https://github.com/ericliang12345/EISRestfulAPI_Dockerfile.git sudo docker build -t eis/restapi_dev .
Run a Docker Container
sudo docker run -it --name eis_api_dev -v $PWD:/home/adv:rw -p 3000:3000 eis/restapi_dev /bin/bash </br> -v : share your local foder with container -p : port mapping internal / external port -name: container name eis/restapi: image</br>
Check Version of NPM & NodeJS
$nodejs -v v4.6.0 $npm -v 2.15.9