Skip to content

Commit

Permalink
host-ctr: specify non-colliding runc root
Browse files Browse the repository at this point in the history
The runc root directory is used for storing state needed by the runtime
shim.  By default, this is /run/containerd/runc.  Since we configure
host containers to use /run/host-containerd instead of /run/containerd,
this change allows all host container state to be inside
/run/host-containerd.
  • Loading branch information
samuelkarp committed Feb 27, 2021
1 parent ee56d1f commit b22168e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sources/host-ctr/cmd/host-ctr/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/oci"
"github.com/containerd/containerd/remotes/docker"
"github.com/containerd/containerd/runtime/v2/runc/options"
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -244,6 +245,9 @@ func runCtr(containerdSocket string, namespace string, containerID string, sourc
containerID,
containerd.WithImage(img),
containerd.WithNewSnapshot(containerID+"-snapshot", img),
containerd.WithRuntime("io.containerd.runc.v2", &options.Options{
Root: "/run/host-containerd/runc",
}),
ctrOpts,
)
if err != nil {
Expand Down

0 comments on commit b22168e

Please sign in to comment.