Allow DefaultCommand to be customized during build #87
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There exist a handful of OCI runtimes, notably crun and youki, which do not ship ContainerD shims but are indirectly supported via containerd-shim-runc-v2 (a.k.a. runtime 'io.containerd.runc.v2') by virtue of being drop-in replacements for runC. These runtimes are more awkward to install and use within the ContainerD ecosystem compared to runtimes which have dedicated shims. It is only possible to e.g. use crun and runc side by side with ContainerD clients which have support compiled in to pass the
BinaryName
option to containerd-shim-runc-v2. For ContainerD clients such as Moby where it would be a security risk to permit users to specify arbitrary BinaryName values, the runtimes must be explicitly registered with it before they can be used. The other option is to install one of the runtimes asrunc
on the system PATH (as is done for ContainerD CI with crun) which works without any client support but precludes more than one such runtime being installed at the same time. In contrast, runtimes which ship their own ContainerD shims, such as gVisor and kata, can be ambiently installed side by side with each other and runC, and can be used by any ContainerD client without any special support or registration. (There are no security concerns with Moby as shim binaries must be on PATH and have names which begin with 'containerd-shim-' to be useable with ContainerD, notwithstanding absolute paths.)Change DefaultCommand to a variable so that applications which use go-runc can be configured at build time to execute a custom runC-compatible command by default. This allows distribution packagers and others to build e.g. dedicated ContainerD shims for crun and youki without having to maintain forks/patchsets or modify any code.