Struct oci_spec::runtime::Hooks[][src]

pub struct Hooks {
    pub prestart: Option<Vec<Hook>>,
    pub create_runtime: Option<Vec<Hook>>,
    pub create_container: Option<Vec<Hook>>,
    pub start_container: Option<Vec<Hook>>,
    pub poststart: Option<Vec<Hook>>,
    pub poststop: Option<Vec<Hook>>,
}
Expand description

Hooks specifies a command that is run in the container at a particular event in the lifecycle (setup and teardown) of a container.

Fields

prestart: Option<Vec<Hook>>
👎 Deprecated:

Prestart hooks were deprecated in favor of createRuntime, createContainer and startContainer hooks

The prestart hooks MUST be called after the start operation is called but before the user-specified program command is executed.

On Linux, for example, they are called after the container namespaces are created, so they provide an opportunity to customize the container (e.g. the network namespace could be specified in this hook).

The prestart hooks’ path MUST resolve in the runtime namespace. The prestart hooks MUST be executed in the runtime namespace.

create_runtime: Option<Vec<Hook>>

CreateRuntime is a list of hooks to be run after the container has been created but before pivot_root or any equivalent operation has been called. It is called in the Runtime Namespace.

create_container: Option<Vec<Hook>>

CreateContainer is a list of hooks to be run after the container has been created but before pivot_root or any equivalent operation has been called. It is called in the Container Namespace.

start_container: Option<Vec<Hook>>

StartContainer is a list of hooks to be run after the start operation is called but before the container process is started. It is called in the Container Namespace.

poststart: Option<Vec<Hook>>

Poststart is a list of hooks to be run after the container process is started. It is called in the Runtime Namespace.

poststop: Option<Vec<Hook>>

Poststop is a list of hooks to be run after the container process exits. It is called in the Runtime Namespace.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.