Fix compilation for all tags
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
59093a22d0
commit
18d01f19e4
4 changed files with 39 additions and 5 deletions
|
@ -63,7 +63,7 @@ var StartCommand = cli.Command{
|
||||||
fatal("container id cannot be empty", 1)
|
fatal("container id cannot be empty", 1)
|
||||||
}
|
}
|
||||||
c := v1.NewClient(context.GlobalString("addr"))
|
c := v1.NewClient(context.GlobalString("addr"))
|
||||||
if err := c.Start(id, path); err != nil {
|
if err := c.Start(id, path, ""); err != nil {
|
||||||
fatal(err.Error(), 1)
|
fatal(err.Error(), 1)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -89,7 +89,7 @@ var KillCommand = cli.Command{
|
||||||
fatal("container id cannot be empty", 1)
|
fatal("container id cannot be empty", 1)
|
||||||
}
|
}
|
||||||
c := v1.NewClient(context.GlobalString("addr"))
|
c := v1.NewClient(context.GlobalString("addr"))
|
||||||
if err := c.Signal(id, context.Int("pid"), context.Int("signal")); err != nil {
|
if err := c.SignalProcess(id, context.Int("pid"), context.Int("signal")); err != nil {
|
||||||
fatal(err.Error(), 1)
|
fatal(err.Error(), 1)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
21
runc/runc.go
21
runc/runc.go
|
@ -4,6 +4,7 @@ package runc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
@ -86,6 +87,26 @@ func (c *runcContainer) Pause() error {
|
||||||
return c.newCommand("pause").Run()
|
return c.newCommand("pause").Run()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: pass arguments
|
||||||
|
func (c *runcContainer) Checkpoint(runtime.Checkpoint) error {
|
||||||
|
return c.newCommand("checkpoint").Run()
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: pass arguments
|
||||||
|
func (c *runcContainer) Restore(cp string) error {
|
||||||
|
return c.newCommand("restore").Run()
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: pass arguments
|
||||||
|
func (c *runcContainer) DeleteCheckpoint(cp string) error {
|
||||||
|
return errors.New("not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: implement in runc
|
||||||
|
func (c *runcContainer) Checkpoints() ([]runtime.Checkpoint, error) {
|
||||||
|
return nil, errors.New("not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
func (c *runcContainer) newCommand(args ...string) *exec.Cmd {
|
func (c *runcContainer) newCommand(args ...string) *exec.Cmd {
|
||||||
cmd := exec.Command("runc", append([]string{"--root", c.stateDir, "--id", c.id}, args...)...)
|
cmd := exec.Command("runc", append([]string{"--root", c.stateDir, "--id", c.id}, args...)...)
|
||||||
cmd.Dir = c.path
|
cmd.Dir = c.path
|
||||||
|
|
12
supervisor_runc.go
Normal file
12
supervisor_runc.go
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
// +build runc
|
||||||
|
|
||||||
|
package containerd
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/docker/containerd/runc"
|
||||||
|
"github.com/docker/containerd/runtime"
|
||||||
|
)
|
||||||
|
|
||||||
|
func newRuntime(stateDir string) (runtime.Runtime, error) {
|
||||||
|
return runc.NewRuntime(stateDir)
|
||||||
|
}
|
|
@ -1,12 +1,13 @@
|
||||||
// +build !libcontainer
|
// +build !libcontainer,!runc
|
||||||
|
|
||||||
package containerd
|
package containerd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/docker/containerd/runc"
|
"errors"
|
||||||
|
|
||||||
"github.com/docker/containerd/runtime"
|
"github.com/docker/containerd/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
func newRuntime(stateDir string) (runtime.Runtime, error) {
|
func newRuntime(stateDir string) (runtime.Runtime, error) {
|
||||||
return runc.NewRuntime(stateDir)
|
return nil, errors.New("unsupported platform")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue