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:
committed by
Akihiro Suda
parent
73466a200d
commit
4535198999
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user