问题描述
自己在ubuntu10.04的服务器上搭了一个warden的环境,在命令行直接create可以成功创建container。查看create--helpcreate命令提供--bind_mounts选项,用于完成宿主机和虚拟机的文件路径映射,create--help的内容如下:command:createdescription:Createacontainer,optionallypassoptions.usage:create[options][options]canbeoneofthefollowing:--bind_mounts[index]#array.src_path<src_path>(string)#required.dst_path<dst_path>(string)#required.mode<mode>(RO,RW)#required[--grace_time<grace_time>(uint32)]#optional[--handle<handle>(string)]#optional[--network<network>(string)]#optional[--rootfs<rootfs>(string)]#optional
git的指导文档给出的说明是:bind_mountsIfsupplied,thisspecifiesasetofpathstobebindmountedinsidethecontainer.Thevaluemustbeanarray.Theelementsinthisarrayspecifythebindmountstoexecute,andareexecutedinorder.Everyelementmustbeoftheform:[#Pathinthehostfilesystem"/host/path",#Pathinthecontainer"/path/in/container",#Optionalhashwithoptions.The`mode`keyspecifieswhetherthebind#mountshouldberemountedas`ro`(read-only)or`rw`(read-write).{"mode"=>"ro|rw"}]
我理解的命令行格式是:create--bind_mounts["/wardentest","/tmp/warden/rootfs/zyz",{"mode"=>"RW"}]可是执行时却报错,网上搜索也找不到该命令选项的使用示例,不知道社区有没有大神用过这个命令,指导一下这个--bind_mounts选项到底该怎么写,谢谢!
解决方案
解决方案二:
这个时候应该找个大神出马啦