Struct docker_command::RunOpt[][src]

pub struct RunOpt {
    pub image: String,
    pub env: Vec<(OsString, OsString)>,
    pub detach: bool,
    pub init: bool,
    pub name: Option<String>,
    pub network: Option<String>,
    pub user: Option<UserAndGroup>,
    pub read_only: bool,
    pub remove: bool,
    pub volumes: Vec<Volume>,
    pub command: Option<PathBuf>,
    pub args: Vec<OsString>,
}
Expand description

Options for running a container.

Fields

image: String

Container image to run.

env: Vec<(OsString, OsString)>

Set environment variables.

detach: bool

If true, run the container in the background and print container ID. Defaults to false.

init: bool

Run an init inside the container that forwards signals and reaps processes.

name: Option<String>

Optional name to give the container.

network: Option<String>

Connect a container to a network.

user: Option<UserAndGroup>

User (and optionally) group to use inside the container.

read_only: bool

Mount the container’s root filesystem as read only.

remove: bool

If true, automatically remove the container when it exits. Defaults to false.

volumes: Vec<Volume>

Volumes to mount in the container.

command: Option<PathBuf>

Optional command to run.

args: Vec<OsString>

Optional arguments to pass to the command.

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

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

This method tests for !=.

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.