@@ -22,7 +22,6 @@ import (
2222 "encoding/json"
2323 "fmt"
2424 "io/ioutil"
25- "runtime"
2625 "strings"
2726
2827 "github.com/containerd/console"
@@ -38,67 +37,6 @@ import (
3837 "github.com/urfave/cli"
3938)
4039
41- // ContainerFlags are cli flags specifying container options
42- var ContainerFlags = []cli.Flag {
43- cli.StringFlag {
44- Name : "config,c" ,
45- Usage : "path to the runtime-specific spec config file" ,
46- },
47- cli.StringFlag {
48- Name : "checkpoint" ,
49- Usage : "provide the checkpoint digest to restore the container" ,
50- },
51- cli.StringFlag {
52- Name : "cwd" ,
53- Usage : "specify the working directory of the process" ,
54- },
55- cli.StringSliceFlag {
56- Name : "env" ,
57- Usage : "specify additional container environment variables (i.e. FOO=bar)" ,
58- },
59- cli.StringSliceFlag {
60- Name : "label" ,
61- Usage : "specify additional labels (i.e. foo=bar)" ,
62- },
63- cli.StringSliceFlag {
64- Name : "mount" ,
65- Usage : "specify additional container mount (ex: type=bind,src=/tmp,dst=/host,options=rbind:ro)" ,
66- },
67- cli.BoolFlag {
68- Name : "net-host" ,
69- Usage : "enable host networking for the container" ,
70- },
71- cli.BoolFlag {
72- Name : "privileged" ,
73- Usage : "run privileged container" ,
74- },
75- cli.BoolFlag {
76- Name : "read-only" ,
77- Usage : "set the containers filesystem as readonly" ,
78- },
79- cli.StringFlag {
80- Name : "runtime" ,
81- Usage : "runtime name (io.containerd.runtime.v1.linux, io.containerd.runtime.v1.windows, io.containerd.runtime.v1.com.vmware.linux)" ,
82- Value : fmt .Sprintf ("io.containerd.runtime.v1.%s" , runtime .GOOS ),
83- },
84- cli.BoolFlag {
85- Name : "tty,t" ,
86- Usage : "allocate a TTY for the container" ,
87- },
88- cli.StringSliceFlag {
89- Name : "with-ns" ,
90- Usage : "specify existing Linux namespaces to join at container runtime (format '<nstype>:<path>')" ,
91- },
92- cli.StringFlag {
93- Name : "pid-file" ,
94- Usage : "file path to write the task's pid" ,
95- },
96- cli.IntFlag {
97- Name : "gpus" ,
98- Usage : "add gpus to the container" ,
99- },
100- }
101-
10240func loadSpec (path string , s * specs.Spec ) error {
10341 raw , err := ioutil .ReadFile (path )
10442 if err != nil {
@@ -181,7 +119,7 @@ var Command = cli.Command{
181119 Name : "fifo-dir" ,
182120 Usage : "directory used for storing IO FIFOs" ,
183121 },
184- }, append (commands .SnapshotterFlags , ContainerFlags ... )... ),
122+ }, append (commands .SnapshotterFlags , commands . ContainerFlags ... )... ),
185123 Action : func (context * cli.Context ) error {
186124 var (
187125 err error
0 commit comments