You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

To support additional functionality, Dobby allows developers to create C++ plugins that can execute code at various stages of a containers lifecycle such as before creation, during startup or at container shutdown. This could be used to map devices, configure networking/iptables or setup displays. Dobby uses a mixture of custom hook-points and OCI hooks (https://github.com/opencontainers/runtime-spec/blob/master/config.md#posix-platform-hooks) to support this.

Hook Points

The following table shows the various hook points that a developer can use in their plugins:

Proposed Container Hooks Required for Plugin Support
Diagram Ref #NameExecution NamespacePath Resolution NamespaceWhenResponsibility
4postInstallationhosthost

After the OCI bundle has been downloaded to the client STB, before the runtime’s create operation is called. Only run once per container - if the container is stopped and restarted this hook does not run again

Can modify the container config file

Dobby
5preCreationhosthost

After postInstallation, but before the create operation is called. Is run every time the container is launched.

Can modify the container config file

Dobby
9createRuntimehosthost

During the create operation, after the runtime environment has been created and before the pivot root or any equivalent operation.

This hook, and subsequent hooks, can not modify the container config

OCI Runtime (crun)
10createContainercontainerhostDuring the create operation, after the runtime environment has been created and before the pivot root or any equivalent operation.OCI Runtime (crun)
12startContainercontainercontainerAfter the start operation is called but before the user-specified program command is executed.OCI Runtime (crun)
14postStarthosthostAfter the user-specified process is executed but before the start operation returns.OCI Runtime (crun)
16postHalthosthostWhen a SIGTERM signal is received from the container. Before the delete operation is calledDobby
20postStophosthostAfter the container is deleted but before the delete operation returns.OCI Runtime (crun)

Container NamespaceOCI-BundleD-Bus/ThunderAPIDobbyDaemonDobby PluginLauncherOCI Runtime(crun)1system startupStart Container2Start containerfork per-App threads3read bundle*4postInstallation5preCreation6create container7Create ContainercontainerizedApp8 Dobby PluginLauncher9createRuntime10createContainerpaths in host NSexecution in container NS11start container12startContainer13start containerised app14postStart15do stuff16SIGTERM17postHalt18delete19delete container20postStop21 Clean up per contianerDobby thread(s)

  • No labels