diff --git a/containerd/service.go b/containerd/service.go index 657c79b..ebbf209 100644 --- a/containerd/service.go +++ b/containerd/service.go @@ -132,10 +132,6 @@ func (s *service) Create(ctx context.Context, request *taskAPI.CreateTaskRequest return nil, err } - if err = os.MkdirAll(path.Join(rootfs, "var", "run"), 0o755); err != nil { - return nil, err - } - // Workaround for 104-char limit of UNIX socket path shortenedRootfsPath, err := filepath.Rel(wd, path.Join(rootfs)) if err != nil || len(shortenedRootfsPath) > len(rootfs) { @@ -287,6 +283,10 @@ func (s *service) Start(ctx context.Context, request *taskAPI.StartRequest) (*ta return nil, err } + if err = os.MkdirAll(path.Dir(c.dnsSocketPath), 0o755); err != nil { + return nil, err + } + dnsSocket, err := net.ListenUnix("unix", &net.UnixAddr{Name: c.dnsSocketPath, Net: "unix"}) if err != nil { return nil, err