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. LINUX 内核学习博客

    http://www.cnblogs.com/yjf512/category/385367.html

  2. Spark RDD的fold和aggregate为什么是两个API?为什么不是一个foldLeft?

    欢迎关注我的新博客地址:http://cuipengfei.me/blog/2014/10/31/spark-fold-aggregate-why-not-foldleft/ 大家都知道Scala标准 ...

  3. Linux source命令(转)

    Linux source命令: 通常用法:source filepath 或 . filepath 功能:使当前shell读入路径为filepath的shell文件并依次执行文件中的所有语句,通常用于 ...

  4. 使用jQuery实现图片懒加载原理

    原文:https://www.liaoxuefeng.com/article/00151045553343934ba3bb4ed684623b1bf00488231d88d000 在网页中,常常需要用 ...

  5. SugarCRM 插件介绍

    [转自 陈沙克日志:http://hi.baidu.com/chenshake/item/5d76203fe6a598fede22219d]经常有朋友问关于sugar的插件,我这里就整理一下,不过其实 ...

  6. sqlite数据库实现字符串查找的方法(instr,substring,charindex替代方案)

    sqlite数据库是一款轻型的数据库,是遵守ACID的关联式数据库管理系统,资源占用低,执行效率高,可以跨平台使用,已被广泛使用.作为一款轻量级的数据库,功能自然会有所欠缺,比如数据库加密,用户权限设 ...

  7. Ioc:Autofac Registration Concepts

    Reflection Components When using reflection-based components, Autofac automatically uses the constru ...

  8. 禁止tomcat生成catalina.out、localhost_access_log、host-manager.log、localhost.log、manager.log这些文件

    1.找到tomcat目录conf,logging.properties把这个文件重命名(推荐:也可以根据自己的需要更改里面的配置文件) 其实删掉也可以但是不建义 这样就不会生成host-manager ...

  9. SharePoint Online 创建资产库

    前言 本文介绍如何在Office 365中创建资产库库,以及资产库的一些基本设置. 正文 通过登录地址登录到Office 365的SharePoint Online站点中,我们可以在右上角的设置菜单中 ...

  10. 详细解释如何通过Android自带的方式来实现图片的裁剪——原理分析+解决方案

    我们很多时候需要进行图片的裁剪,其实这个功能在android系统中已经有一套解决方案了,虽然界面和效果并不是很优秀但功能毫无疑问是完美实现了.至于,不用自带的方案怎么做自定义,这个就是后话了.本篇主要 ...