diff --git a/server/container_create.go b/server/container_create.go index ca0ed788..263443bd 100644 --- a/server/container_create.go +++ b/server/container_create.go @@ -47,6 +47,10 @@ func addOciBindMounts(sb *sandbox, containerConfig *pb.ContainerConfig, specgen return fmt.Errorf("Mount.HostPath is empty") } + if _, err := os.Stat(src); err != nil && os.IsNotExist(err) { + os.MkdirAll(src, 0644) + } + options := []string{"rw"} if mount.Readonly { options = []string{"ro"}