Move runtime and Mounts to container config
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
3551d4c0b9
commit
788e19d251
6 changed files with 56 additions and 72 deletions
|
@ -6,23 +6,16 @@ import (
|
|||
"io"
|
||||
"os"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/docker/containerd/shim"
|
||||
"github.com/docker/containerkit"
|
||||
"github.com/docker/containerkit/osutils"
|
||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||
)
|
||||
|
||||
func reloadContainer() error {
|
||||
// create a new runtime runtime that implements the ExecutionDriver interface
|
||||
runtime, err := shim.Load("/run/cshim/test")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
dockerContainer := &testConfig{}
|
||||
container, err := containerkit.LoadContainer(dockerContainer, runtime)
|
||||
container, err := containerkit.LoadContainer(dockerContainer)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -44,20 +37,10 @@ func reloadContainer() error {
|
|||
|
||||
func runContainer() error {
|
||||
// create a new runtime runtime that implements the ExecutionDriver interface
|
||||
runtime, err := shim.New(shim.Opts{
|
||||
Root: "/run/cshim/test",
|
||||
Name: "containerd-shim",
|
||||
RuntimeName: "runc",
|
||||
RuntimeRoot: "/run/runc",
|
||||
Timeout: 5 * time.Second,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
dockerContainer := &testConfig{}
|
||||
|
||||
// create a new container
|
||||
container, err := containerkit.NewContainer(dockerContainer, NewBindDriver(), runtime)
|
||||
container, err := containerkit.NewContainer(dockerContainer)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue