Add shim log pipe for log forwarding to the daemon

A fifo on unix or named pipe on Windows will be provided to the shim.
It can be located inside the `cwd` of the shim named "log".
The shims can use the existing `github.com/containerd/containerd/log` package to log debug messages.
Messages will automatically be output in the containerd's daemon logs with the correct fiels and runtime set.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2018-08-06 13:49:09 -04:00
parent 2783a19b10
commit 6ba4ddfdda
9 changed files with 178 additions and 19 deletions

View File

@@ -19,16 +19,10 @@
package main
import (
"fmt"
"os"
"github.com/containerd/containerd/runtime/v2/runc"
"github.com/containerd/containerd/runtime/v2/shim"
)
func main() {
if err := shim.Run(runc.New); err != nil {
fmt.Fprintf(os.Stderr, "containerd-shim-runc-v1: %s\n", err)
os.Exit(1)
}
shim.Run("io.containerd.runc.v1", runc.New)
}