Allow specification of rootfs in ctr

carry: justincormack/containerd@ffe684b017

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
Justin Cormack
2017-04-14 19:51:50 +00:00
committed by Akihiro Suda
parent 73466a200d
commit 4535198999
3 changed files with 24 additions and 17 deletions

View File

@@ -34,6 +34,10 @@ var runCommand = cli.Command{
Name: "tty,t",
Usage: "allocate a TTY for the container",
},
cli.StringFlag{
Name: "rootfs",
Usage: "path to rootfs",
},
cli.StringFlag{
Name: "runtime",
Usage: "runtime name (linux, windows, vmware-linux)",
@@ -89,7 +93,7 @@ var runCommand = cli.Command{
return errors.Wrap(err, "failed resolving image store")
}
if runtime.GOOS != "windows" {
if runtime.GOOS != "windows" && context.String("rootfs") == "" {
ref := context.Args().First()
image, err := imageStore.Get(ctx, ref)
@@ -141,7 +145,7 @@ var runCommand = cli.Command{
// TODO: get the image / rootfs through the API once windows has a snapshotter
}
create, err := newCreateRequest(context, &imageConfig.Config, id, tmpDir)
create, err := newCreateRequest(context, &imageConfig.Config, id, tmpDir, context.String("rootfs"))
if err != nil {
return err
}