自己在ubuntu10.04的服務器上搭了一個warden的環境,在命令列直接create可以成功創建container。查看create --help
create命令提供--bind_mounts選項,用于完成宿主機和虛擬機的檔案路徑映射,create --help的內容如下:
command: create
description: Create a container, optionally pass options.
usage: create [options]
[options] can be one of the following:
--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_mounts
If supplied, this specifies a set of paths to be bind mounted inside the container. The value must be an array. The elements in this array specify the bind mounts to execute, and are executed in order. Every element must be of the form:
[
# Path in the host filesystem
"/host/path",
# Path in the container
"/path/in/container",
# Optional hash with options. The `mode` key specifies whether the bind
# mount should be remounted as `ro` (read-only) or `rw` (read-write).
{
"mode" => "ro|rw"
}
]
我理解的命令列格式是:
create --bind_mounts ["/wardentest","/tmp/warden/rootfs/zyz",{"mode"=>"RW"}]
可是執行時卻報錯,網上搜索也找不到該命令選項的使用示例,不知道社區有沒有大神用過這個命令,指導一下這個--bind_mounts選項到底該怎么寫,謝謝!
uj5u.com熱心網友回復:
這個時候應該找個大神出馬啦轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/94356.html
