[−][src]Struct docker_client::container::config::ConfigBuilder
A Config
builder.
This type can be used to construct an instance Config
through a builder-like pattern.
Examples
Construct a Config
example.
use docker_client::container::ConfigBuilder; fn main() { let builder = ConfigBuilder::with_image("alpine") .name("example") .hostname("localhost") .expose_port("80/tcp") .build(); println!("{:?}", builder); }
Methods
impl ConfigBuilder
[src]
pub fn new() -> Self
[src]
Creates a new default instance of ConfigBuilder
to construct a Config
.
pub fn with_image<T>(image: T) -> Self where
T: Into<String>,
[src]
T: Into<String>,
Creates a new ConfigBuilder
initialized with image
.
This method returns an instance of ConfigBuilder
which can be used to create a Config
.
Examples
Create a new CreationBuilder
with image.
let builder = ConfigBuilder::with_image("example-image").build();
pub fn name<T>(&mut self, name: T) -> &mut Self where
T: Into<String>,
[src]
T: Into<String>,
Set name for this container.
Examples
let builder = ConfigBuilder::with_image("alpine") .name("example-name") .build();
pub fn hostname<T>(&mut self, name: T) -> &mut Self where
T: Into<String>,
[src]
T: Into<String>,
Set hostname for this container.
Examples
let builder = ConfigBuilder::with_image("alpine") .hostname("example-hostname") .build();
pub fn domain_name<T>(&mut self, name: T) -> &mut Self where
T: Into<String>,
[src]
T: Into<String>,
Set domain name for this container.
Examples
let builder = ConfigBuilder::with_image("alpine") .domain_name("example-domainname") .build();
pub fn user<T>(&mut self, name: T) -> &mut Self where
T: Into<String>,
[src]
T: Into<String>,
Set user for this container.
Examples
let builder = ConfigBuilder::with_image("alpine") .user("example-user") .build();
pub fn attach_stdin(&mut self, b: bool) -> &mut Self
[src]
Set boolean flag attach_stdin
for this container.
Examples
let builder = ConfigBuilder::with_image("alpine") .attach_stdin(true) .build();
pub fn attach_stdout(&mut self, b: bool) -> &mut Self
[src]
Set boolean flag attach_stdout
for this container.
Examples
let builder = ConfigBuilder::with_image("alpine") .attach_stdout(true) .build();
pub fn attach_stderr(&mut self, b: bool) -> &mut Self
[src]
Set boolean flag attach_stderr
for this container.
Examples
let builder = ConfigBuilder::with_image("alpine") .attach_stderr(true) .build();
pub fn expose_port<T>(&mut self, port: T) -> &mut Self where
T: Into<String>,
[src]
T: Into<String>,
Expose port of container to this Config builder.
Examples
let builder = ConfigBuilder::with_image("alpine") .expose_port("22/tcp") .build();
pub fn tty(&mut self, b: bool) -> &mut Self
[src]
Set boolean flag tty
for this container.
Examples
let builder = ConfigBuilder::with_image("alpine") .tty(true) .build();
pub fn open_stdin(&mut self, b: bool) -> &mut Self
[src]
Set boolean flag open_stdin
for this container.
Examples
let builder = ConfigBuilder::with_image("alpine") .open_stdin(true) .build();
pub fn stdin_once(&mut self, b: bool) -> &mut Self
[src]
Set boolean flag stdin_once
for this container.
Examples
let builder = ConfigBuilder::with_image("alpine") .stdin_once(true) .build();
pub fn env<T>(&mut self, env: T) -> &mut Self where
T: Into<String>,
[src]
T: Into<String>,
Append environment variable for this container.
Examples
let builder = ConfigBuilder::with_image("alpine") .env("VAR=example-value") .build();
pub fn cmd<T>(&mut self, cmd: T) -> &mut Self where
T: Into<String>,
[src]
T: Into<String>,
Append command for this container.
Examples
let builder = ConfigBuilder::with_image("alpine") .cmd("example-cmd") .build();
pub fn health_check(&mut self, health_check: Option<HealthCheck>) -> &mut Self
[src]
Set HealthCheck
for this container.
pub fn args_escaped(&mut self, b: bool) -> &mut Self
[src]
pub fn image<T>(&mut self, image: T) -> &mut Self where
T: Into<String>,
[src]
T: Into<String>,
Set image for this container.
Examples
let builder = ConfigBuilder::new() .image("alpine") .build();
pub fn volume<T>(&mut self, volume: T) -> &mut Self where
T: Into<String>,
[src]
T: Into<String>,
Append volume for this container.
Examples
let builder = ConfigBuilder::with_image("alpine") .volume("/path/to/volume") .build();
pub fn work_dir<T>(&mut self, work_dir: T) -> &mut Self where
T: Into<String>,
[src]
T: Into<String>,
Set work directory for this container.
Examples
let builder = ConfigBuilder::with_image("alpine") .work_dir("/path/to/work_dir") .build();
pub fn entry_point<T>(&mut self, entry_point: T) -> &mut Self where
T: Into<String>,
[src]
T: Into<String>,
Append entry point script.
Examples
let builder = ConfigBuilder::with_image("alpine") .entry_point("example-entry-point") .build();
pub fn network_disabled(&mut self, b: bool) -> &mut Self
[src]
Set flag network_disabled
for this container.
Note
- If
b
isfalse
then network will enable. - If
b
istrue
then network will disable.
Examples
let builder = ConfigBuilder::with_image("alpine") .network_disabled(true) .build();
pub fn mac_address<T>(&mut self, mac_address: T) -> &mut Self where
T: Into<String>,
[src]
T: Into<String>,
Set MAC address for this container.
Examples
let builder = ConfigBuilder::with_image("alpine") .mac_address("1A:2B:3C:4D:5E:6F") .build();
pub fn on_build<T>(&mut self, cmd: T) -> &mut Self where
T: Into<String>,
[src]
T: Into<String>,
Append on build script.
Examples
let builder = ConfigBuilder::with_image("alpine") .on_build("command-on-build") .build();
pub fn label<T, U>(&mut self, k: T, v: U) -> &mut Self where
T: Into<String>,
U: Into<String>,
[src]
T: Into<String>,
U: Into<String>,
Append label of container.
Examples
let builder = ConfigBuilder::with_image("alpine") .label("example-label-key", "example-label-value") .build();
pub fn stop_signal<T>(&mut self, stop_signal: T) -> &mut Self where
T: Into<String>,
[src]
T: Into<String>,
Set stop signal.
Examples
let builder = ConfigBuilder::with_image("alpine") .stop_signal("command") .build();
pub fn stop_timeout(&mut self, time: Option<i32>) -> &mut Self
[src]
Set stop timeout.
Examples
let builder = ConfigBuilder::with_image("alpine") .stop_timeout(None) .stop_timeout(Some(100)) .build();
pub fn shell<T>(&mut self, cmd: T) -> &mut Self where
T: Into<String>,
[src]
T: Into<String>,
Append shell command.
Examples
let builder = ConfigBuilder::with_image("alpine") .shell("shell-command") .shell("shell-command-1") .build();
pub fn build(&self) -> Config
[src]
Trait Implementations
impl Default for ConfigBuilder
[src]
fn default() -> ConfigBuilder
[src]
impl Debug for ConfigBuilder
[src]
Auto Trait Implementations
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,