diff --git a/cmd/containerd/config.go b/cmd/containerd/config.go index 146a4a4..9964813 100644 --- a/cmd/containerd/config.go +++ b/cmd/containerd/config.go @@ -58,6 +58,8 @@ func (c *config) decodePlugin(name string, v interface{}) error { type grpcConfig struct { Socket string `toml:"socket"` + Uid int `toml:"uid"` + Gid int `toml:"gid"` } type debug struct { diff --git a/cmd/containerd/main.go b/cmd/containerd/main.go index b7224bc..8e2a234 100644 --- a/cmd/containerd/main.go +++ b/cmd/containerd/main.go @@ -330,6 +330,9 @@ func serveGRPC(server *grpc.Server) error { if err != nil { return err } + if err := os.Chown(path, conf.GRPC.Uid, conf.GRPC.Gid); err != nil { + return err + } go func() { defer l.Close() if err := server.Serve(l); err != nil {