shim: support non-default binary name
The binary name used for executing "containerd publish" was hard-coded in the shim code, and hence it did not work with customized daemon binary name. (e.g. `docker-containerd`) This commit allows specifying custom daemon binary via `containerd-shim -containerd-binary ...`. The daemon invokes this command with `os.Executable()` path. Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
@@ -89,10 +89,15 @@ func WithStart(binary, address, daemonAddress, cgroup string, nonewns, debug boo
|
||||
}
|
||||
|
||||
func newCommand(binary, daemonAddress string, nonewns, debug bool, config shim.Config, socket *os.File) *exec.Cmd {
|
||||
selfExe, err := os.Executable()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
args := []string{
|
||||
"-namespace", config.Namespace,
|
||||
"-workdir", config.WorkDir,
|
||||
"-address", daemonAddress,
|
||||
"-containerd-binary", selfExe,
|
||||
}
|
||||
|
||||
if config.Criu != "" {
|
||||
|
||||
Reference in New Issue
Block a user