Normally when you create a Volume, it will store in Docket Host, you can also tell the folder which you want docket to store the volume.

docker run  -p : -v /var/www node # run with a node image

You can check the volume information by:

docker inspect <container_id>

In the output JSON, you need to find "Mount" prop, it contains the information.

If you want to create a custom folder to store the volme, you can do:

docker run  -p : -v $(pwd):/var/www node

Remove container with volume:

docker rm -v <container_id>

------

We can create a node express app and put that into docker with volume.

npm i -g express express-generator

Create an express app:

express ExpressSite --hbs

Cd to the project and put souce code into docker, meanwhile we want to npm 'npm start' as well.

# create a volume: -v
# $(pwd): current path, means you want to create volume in your folder
# -w: current working directory "/var/www"
# start the image node
# run script: npm start docker run -p : -v $(pwd):/var/www -w "/var/www" node npm start

[Docker] Hooking a Volume to Node.js Source Code的更多相关文章

  1. Node.js v7.4.0 Documentation Addons

    https://nodejs.org/docs/latest/api/addons.html Node.js Addons are dynamically-linked shared objects, ...

  2. 个推Node.js 微服务实践:基于容器的一站式命令行工具链

    作者:个推Node.js 开发工程师 之诺 背景与摘要 由于工程数量的快速增长,个推在实践基于 Node.js 的微服务开发的过程中,遇到了如下问题: 1. 每次新建项目都需要安装一次依赖,这些依赖之 ...

  3. Docker 生成Node.js web app(含端口映射)

    1.新建目录src,并进入src目录 [xiejdm@localhost Documents]$ mkdir src [xiejdm@localhost Documents]$ cd src/ 2.创 ...

  4. Docker学习之——Node.js+MongoDB+Nginx环境搭建(一)

    最近在学习Node.js相关知识,在环境搭建上耗费了不少功夫,故此把这个过程写下来同大家分享一下,今天我先来介绍一下Docker,有很多人都写过相关知识,还有一些教程,在此我只想写一下,我的学习过程中 ...

  5. 如何用Docker建立一个Node.js的开发环境

      建立一个文件夹 用管理员身份打开powershell. 在文件夹下面运行npm init, 根据提示填入信息,以便产生一个package.json文件. 在文件中加入需要的dependencies ...

  6. 当Node.js遇见Docker

    Node.js Best Practices - How to Become a Better Developer in 2017提到的几点,我们Fundebug深有同感: 使用ES6 使用Promi ...

  7. Docker常见仓库Node.js

    Node.js 基本信息 Node.js是基于 JavaScript 的可扩展服务端和网络软件开发平台. 该仓库提供了 Node.js 0.8 ~ 0.11 各个版本的镜像. 使用方法 在项目中创建一 ...

  8. 私活利器,docker快速部署node.js应用

    http://cnodejs.org/topic/53f494d9bbdaa79d519c9a4a 最近研究了几天docker的快速部署,感觉很有新意,非常轻量级和方便,打算在公司推广一下,解放运维, ...

  9. Docker: 如何将node.js的项目部署到docker的swarm上面去

    前提条件: Docker创建虚机和swarm 如何用Docker建立一个Node.js的开发环境 正文: 将如何用Docker建立一个Node.js的开发环境文中创建的nodehello image发 ...

随机推荐

  1. SPOJ PGCD 4491. Primes in GCD Table && BZOJ 2820 YY的GCD (莫比乌斯反演)

    4491. Primes in GCD Table Problem code: PGCD Johnny has created a table which encodes the results of ...

  2. AT91 USB Composite Driver Implementation

    AT91 USB Composite Driver Implementation 1. Introduction The USB Composite Device is a general way t ...

  3. 【报错】RSA host key for 192.168.1.xxx has changed and you have requested strict checking.

    执行如下对机拷贝命令 scp .ssh/id_rsa.pub phpgo@192.168.1.35:~ 时,报错 RSA host key for 192.168.1.xxx has changed ...

  4. 8张图理解Java---importnew---programcreek

    http://www.importnew.com/11725.html https://www.programcreek.com/2013/09/top-8-diagrams-for-understa ...

  5. LOG EXPLORER ApexSQL Log

    http://www.minisoft.cn/ https://www.apexsql.com/sql_tools_log.aspx

  6. Pylons安装苦逼之路

    本文介绍一下我在安装pylons的过程中出现的一些错误和解决办法,当然这些都是不完全版. 1.在Serve1(服务器Python版本2.4.3)上面装环境的时候总是出现with_statement有关 ...

  7. PHP开启curl_init

    windows主机出现“Call to undefined function curl_init”错误提示,没有定义的函数,也就是php还没打开对curl_init函数的支持. 全文:http://j ...

  8. C#面向服务WebService从入门到精通

    <C#面向服务WebService从入门到精通>包含以下两个部分: 一.<C#远程调用技术WebService修炼手册[基础篇]>本次分享课您将学习到以下干货知识点:1).We ...

  9. C#输出到Release VS中Release模式下生成去掉生成pdb文件

    Release 与 Debug 的区别就不多说了, 简单来说 Release 优化过, 性能高一些. Debug 为方便调试. 默认情况下是 Debug, 那如何改成 Release 呢? 项目上右键 ...

  10. .NET:使用 XPATH 读取有 xmlns 属性的 XML 文档出现的问题

    问题 xml <sqlMap namespace="WHTR.Dao.Accounts" xmlns="http://ibatis.apache.org/mappi ...