Struct bollard::DockerChain
source · pub struct DockerChain<C> { /* private fields */ }
Expand description
DockerChain
Retains the same API as the Docker Client, but consumes the instance and returns the instance as part of the response.
Examples
use bollard::Docker;
let docker = Docker::connect_with_http_defaults().unwrap();
docker.chain();
Implementations§
source§impl<C> DockerChain<C>where
C: Connect + Sync + 'static,
impl<C> DockerChain<C>where
C: Connect + Sync + 'static,
sourcepub fn kill_container<T, K, V>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>where
T: KillContainerQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
pub fn kill_container<T, K, V>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>where
T: KillContainerQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
Kill Container
Kill a container. Consumes the client instance.
Arguments
- Container name as string slice.
- Optional Kill Container Options struct.
Returns
- A Tuple containing the original DockerChain instance, and the unit
type
()
, wrapped in a Future.
Examples
use bollard::container::KillContainerOptions;
let options = Some(KillContainerOptions{
signal: "SIGINT",
});
docker.chain().kill_container("postgres", options);
sourcepub fn remove_container<T, K, V>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>where
T: RemoveContainerQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
pub fn remove_container<T, K, V>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>where
T: RemoveContainerQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
Remove Container
Remove a container. Consumes the instance.
Arguments
- Container name as a string slice.
- Optional Remove Container Options struct.
Returns
- A Tuple containing the original DockerChain instance, and the unit
type
()
, wrapped in a Future.
Examples
use bollard::container::RemoveContainerOptions;
use std::default::Default;
let options = Some(RemoveContainerOptions{
force: true,
..Default::default()
});
docker.chain().remove_container("hello-world", options);
sourcepub fn create_container<T, K, V, Z>(
self,
options: Option<T>,
config: Config<Z>
) -> impl Future<Item = (DockerChain<C>, CreateContainerResults), Error = Error>where
T: CreateContainerQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
Z: AsRef<str> + Eq + Hash + Serialize,
pub fn create_container<T, K, V, Z>(
self,
options: Option<T>,
config: Config<Z>
) -> impl Future<Item = (DockerChain<C>, CreateContainerResults), Error = Error>where
T: CreateContainerQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
Z: AsRef<str> + Eq + Hash + Serialize,
Create Container
Prepares a container for a subsequent start operation. Consumes the instance.
Arguments
- Optional Create Container Options struct.
- Container Config struct.
Returns
- A Tuple containing the original DockerChain instance, and a Create Container Results, wrapped in a Future.
Examples
use bollard::container::{CreateContainerOptions, Config};
use std::default::Default;
let options = Some(CreateContainerOptions{
name: "my-new-container",
});
let config = Config {
image: Some("hello-world"),
cmd: Some(vec!["/hello"]),
..Default::default()
};
docker.chain().create_container(options, config);
sourcepub fn start_container<T, K, V>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>where
T: StartContainerQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
pub fn start_container<T, K, V>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>where
T: StartContainerQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
Start Container
Starts a container, after preparing it with the Create Container API. Consumes the client instance.
Arguments
- Container name as a string slice.
- Optional Start Container Options struct.
Returns
- A Tuple containing the original DockerChain instance, and the unit
type
()
, wrapped in a Future.
Examples
use bollard::container::StartContainerOptions;
docker.chain().start_container("hello-world", None::<StartContainerOptions<String>>);
sourcepub fn stop_container<T, K>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>where
T: StopContainerQueryParams<K>,
K: AsRef<str>,
pub fn stop_container<T, K>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>where
T: StopContainerQueryParams<K>,
K: AsRef<str>,
Stop Container
Stops a container. Consumes the client instance.
Arguments
- Container name as string slice.
- Optional Stop Container Options struct.
Returns
- A Tuple containing the original DockerChain instance, and the unit
type
()
, wrapped in a Future.
Examples
use bollard::container::StopContainerOptions;
let options = Some(StopContainerOptions{
t: 30,
});
docker.chain().stop_container("hello-world", options);
sourcepub fn list_containers<T, K>(
self,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, Vec<APIContainers>), Error = Error>where
T: ListContainersQueryParams<K, String>,
K: AsRef<str>,
pub fn list_containers<T, K>(
self,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, Vec<APIContainers>), Error = Error>where
T: ListContainersQueryParams<K, String>,
K: AsRef<str>,
List Containers
Returns a list of containers. Consumes the client instance.
Arguments
- Optional ListContainersOptions struct.
Returns
- A Tuple containing the original DockerChain instance, and a Vector of APIContainers, wrapped in a Future.
Examples
use bollard::container::ListContainersOptions;
use std::collections::HashMap;
use std::default::Default;
let mut filters = HashMap::new();
filters.insert("health", vec!("unhealthy"));
let options = Some(ListContainersOptions{
all: true,
filters: filters,
..Default::default()
});
docker.chain().list_containers(options);
sourcepub fn wait_container<T, K, V>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, impl Stream<Item = WaitContainerResults, Error = Error>), Error = Error>where
T: WaitContainerQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
pub fn wait_container<T, K, V>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, impl Stream<Item = WaitContainerResults, Error = Error>), Error = Error>where
T: WaitContainerQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
Wait Container
Wait for a container to stop. This is a non-blocking operation, the resulting stream will end when the container stops. Consumes the instance.
Arguments
- Container name as string slice.
- Optional Wait Container Options struct.
Returns
- A Tuple containing the original DockerChain instance, and a Wait Container Results, wrapped in a Stream.
Examples
use bollard::container::WaitContainerOptions;
let options = Some(WaitContainerOptions{
condition: "not-running",
});
docker.chain().wait_container("hello-world", options);
sourcepub fn inspect_container<T, K, V>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, Container), Error = Error>where
T: InspectContainerQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
pub fn inspect_container<T, K, V>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, Container), Error = Error>where
T: InspectContainerQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
Inspect Container
Inspect a container. Consumes the instance.
Arguments
- Container name as a string slice.
- Optional Inspect Container Options struct.
Returns
- A Tuple containing the original DockerChain instance, and a Container, wrapped in a Future.
Examples
use bollard::container::InspectContainerOptions;
let options = Some(InspectContainerOptions{
size: false,
});
docker.chain().inspect_container("hello-world", options);
sourcepub fn restart_container<T, K>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>where
T: RestartContainerQueryParams<K>,
K: AsRef<str>,
pub fn restart_container<T, K>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>where
T: RestartContainerQueryParams<K>,
K: AsRef<str>,
Restart Container
Restart a container. Consumes the client instance.
Arguments
- Container name as string slice.
- Optional Restart Container Options struct.
Returns
- A Tuple containing the original DockerChain instance, and the unit
type
()
, wrapped in a Future.
Examples
use bollard::container::RestartContainerOptions;
let options = Some(RestartContainerOptions{
t: 30,
});
docker.chain().restart_container("postgres", options);
sourcepub fn top_processes<T, K, V>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, TopResult), Error = Error>where
T: TopQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
pub fn top_processes<T, K, V>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, TopResult), Error = Error>where
T: TopQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
Top Processes
List processes running inside a container. Consumes the client instance.
Arguments
- Container name as string slice.
- Optional Top Options struct.
Returns
- A Tuple containing the original DockerChain instance, and a TopResult, wrapped in a Future.
Examples
use bollard::container::TopOptions;
let options = Some(TopOptions{
ps_args: "aux",
});
docker.chain().top_processes("fnichol/uhttpd", options);
sourcepub fn logs<T, K>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, impl Stream<Item = LogOutput, Error = Error>), Error = Error>where
T: LogsQueryParams<K>,
K: AsRef<str>,
pub fn logs<T, K>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, impl Stream<Item = LogOutput, Error = Error>), Error = Error>where
T: LogsQueryParams<K>,
K: AsRef<str>,
Logs
Get container logs. Consumes the client instance.
Arguments
- Container name as string slice.
- Optional Logs Query Params struct.
Returns
- A Tuple containing the original DockerChain instance, and a Log Output enum, wrapped in a Stream.
Examples
use bollard::container::LogsOptions;
use std::default::Default;
let options = Some(LogsOptions{
stdout: true,
..Default::default()
});
docker.chain().logs("hello-world", options);
sourcepub fn container_changes(
self,
container_name: &str
) -> impl Future<Item = (DockerChain<C>, Option<Vec<Change>>), Error = Error>
pub fn container_changes(
self,
container_name: &str
) -> impl Future<Item = (DockerChain<C>, Option<Vec<Change>>), Error = Error>
Container Changes
Get changes on a container’s filesystem. Consumes the client instance.
Arguments
- Container name as string slice.
Returns
- A Tuple containing the original DockerChain instance, and an Option of Vector of Change structs, wrapped in a Future.
Examples
docker.chain().container_changes("hello-world");
sourcepub fn stats<T, K, V>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, impl Stream<Item = Stats, Error = Error>), Error = Error>where
T: StatsQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
pub fn stats<T, K, V>(
self,
container_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, impl Stream<Item = Stats, Error = Error>), Error = Error>where
T: StatsQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
Stats
Get container stats based on resource usage. Consumes the client instance.
Arguments
- Container name as string slice.
- Optional Stats Options struct.
Returns
- A Tuple containing the original DockerChain instance, and a Stats struct, wrapped in a Stream.
Examples
use bollard::container::StatsOptions;
let options = Some(StatsOptions{
stream: false,
});
docker.chain().stats("hello-world", options);
sourcepub fn update_container(
self,
container_name: &str,
config: UpdateContainerOptions
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>
pub fn update_container(
self,
container_name: &str,
config: UpdateContainerOptions
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>
Update Container
Update a container. Consumes the client instance.
Arguments
- Container name as string slice.
- Update Container Options struct.
Returns
- A Tuple containing the original DockerChain instance, and the unit
type
()
, wrapped in a Future.
Examples
use bollard::container::UpdateContainerOptions;
use std::default::Default;
let config = UpdateContainerOptions {
memory: Some(314572800),
memory_swap: Some(314572800),
..Default::default()
};
docker.chain().update_container("postgres", config);
sourcepub fn rename_container<T, K, V>(
self,
container_name: &str,
options: T
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>where
T: RenameContainerQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
pub fn rename_container<T, K, V>(
self,
container_name: &str,
options: T
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>where
T: RenameContainerQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
Rename Container
Rename a container. Consumes the client instance.
Arguments
- Container name as string slice.
- Rename Container Options struct
Returns
- A Tuple containing the original DockerChain instance, and the unit
type
()
, wrapped in a Future.
Examples
use bollard::container::RenameContainerOptions;
let required = RenameContainerOptions {
name: "my_new_container_name"
};
docker.chain().rename_container("hello-world", required);
sourcepub fn pause_container(
self,
container_name: &str
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>
pub fn pause_container(
self,
container_name: &str
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>
Pause Container
Use the cgroups freezer to suspend all processes in a container. Consumes the client instance.
Arguments
- Container name as a string slice.
Returns
- A Tuple containing the original DockerChain instance, and the unit
type
()
, wrapped in a Future.
Examples
docker.chain().pause_container("postgres");
sourcepub fn unpause_container(
self,
container_name: &str
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>
pub fn unpause_container(
self,
container_name: &str
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>
Unpause Container
Resume a container which has been paused. Consumes the client instance.
Returns
- A Tuple containing the original DockerChain instance, and the unit
type
()
, wrapped in a Future.
Examples
docker.chain().unpause_container("postgres");
sourcepub fn prune_containers<T, K>(
self,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, PruneContainersResults), Error = Error>where
T: PruneContainersQueryParams<K>,
K: AsRef<str> + Eq + Hash,
pub fn prune_containers<T, K>(
self,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, PruneContainersResults), Error = Error>where
T: PruneContainersQueryParams<K>,
K: AsRef<str> + Eq + Hash,
Prune Containers
Delete stopped containers. Consumes the client instance.
Arguments
- Optional Prune Containers Options struct.
Returns
- A Tuple containing the original DockerChain instance, and a PruneContainersResults struct, wrapped in a Future.
Examples
use bollard::container::PruneContainersOptions;
use std::collections::HashMap;
let mut filters = HashMap::new();
filters.insert("until", vec!("10m"));
let options = Some(PruneContainersOptions {
filters: filters
});
docker.chain().prune_containers(options);
source§impl<C> DockerChain<C>where
C: Connect + Sync + 'static,
impl<C> DockerChain<C>where
C: Connect + Sync + 'static,
sourcepub fn create_image<T, K, V>(
self,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, impl Stream<Item = CreateImageResults, Error = Error>), Error = Error>where
T: CreateImageQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
pub fn create_image<T, K, V>(
self,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, impl Stream<Item = CreateImageResults, Error = Error>), Error = Error>where
T: CreateImageQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
Create Image
Create an image by either pulling it from a registry or importing it. Consumes the client instance.
Arguments
- An optional Create Image Options struct.
Returns
- A Tuple containing the original DockerChain instance, and a Create Image Results, wrapped in an asynchronous Stream.
Examples
use bollard::image::CreateImageOptions;
use std::default::Default;
let options = Some(CreateImageOptions{
from_image: "hello-world",
..Default::default()
});
docker.chain().create_image(options);
// do some other work while the image is pulled from the docker hub...
Unsupported
- Import from tarball
sourcepub fn tag_image<T, K, V>(
self,
image_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>where
T: TagImageQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
pub fn tag_image<T, K, V>(
self,
image_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>where
T: TagImageQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
Tag Image
Tag an image so that it becomes part of a repository. Consumes the instance.
Arguments
- Image name as a string slice.
- Optional Tag Image Options struct.
Returns
- A Tuple containing the original DockerChain instance, and the unit
type
()
, wrapped in a Future.
Examples
use bollard::image::TagImageOptions;
let tag_options = Some(TagImageOptions {
tag: "v1.0.1",
..Default::default()
});
docker.chain().tag_image("hello-world", tag_options);
sourcepub fn push_image<T, K, V>(
self,
image_name: &str,
options: Option<T>,
credentials: Option<DockerCredentials>
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>where
T: PushImageQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
pub fn push_image<T, K, V>(
self,
image_name: &str,
options: Option<T>,
credentials: Option<DockerCredentials>
) -> impl Future<Item = (DockerChain<C>, ()), Error = Error>where
T: PushImageQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
Push Image
Push an image to a registry. Consumes the instance.
Arguments
- Image name as a string slice.
- Optional Push Image Options struct.
- Optional Docker Credentials struct.
Returns
- A Tuple containing the original DockerChain instance, and the unit
type
()
, wrapped in a Future.
Examples
use bollard::auth::DockerCredentials;
use bollard::image::PushImageOptions;
let push_options = Some(PushImageOptions {
tag: "v1.0.1",
});
let credentials = Some(DockerCredentials {
username: Some("Jack".to_string()),
password: Some("myverysecretpassword".to_string()),
email: Some("jack.smith@example.com".to_string()),
serveraddress: Some("localhost:5000".to_string())
});
docker.push_image("hello-world", push_options, credentials);
sourcepub fn remove_image<T, K, V>(
self,
image_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, Vec<RemoveImageResults>), Error = Error>where
T: RemoveImageQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
pub fn remove_image<T, K, V>(
self,
image_name: &str,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, Vec<RemoveImageResults>), Error = Error>where
T: RemoveImageQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
Remove Image
Remove an image, along with any untagged parent images that were referenced by that image. Consumes the client instance.
Arguments
- Image name as a string slice.
- An optional Remove Image Options struct.
Returns
- A Tuple containing the original DockerChain instance, and a Vector of Remove Image Results, wrapped in a Future.
Examples
use bollard::image::RemoveImageOptions;
let remove_options = Some(RemoveImageOptions {
force: true,
..Default::default()
});
docker.chain().remove_image("hello-world", remove_options);
sourcepub fn search_images<T, K>(
self,
options: T
) -> impl Future<Item = (DockerChain<C>, Vec<APIImageSearch>), Error = Error>where
T: SearchImagesQueryParams<K>,
K: AsRef<str>,
pub fn search_images<T, K>(
self,
options: T
) -> impl Future<Item = (DockerChain<C>, Vec<APIImageSearch>), Error = Error>where
T: SearchImagesQueryParams<K>,
K: AsRef<str>,
Search Images
Search for an image on Docker Hub. Consumes the client instance.
Arguments
- Search Image Options struct.
Returns
- A Tuple containing the original DockerChain instance, and a Vector of API Image Search results, wrapped in a Future.
Examples
use bollard::image::SearchImagesOptions;
use std::default::Default;
use std::collections::HashMap;
let mut filters = HashMap::new();
filters.insert("until", "10m");
let search_options = SearchImagesOptions {
term: "hello-world",
filters: filters,
..Default::default()
};
docker.chain().search_images(search_options);
sourcepub fn inspect_image(
self,
image_name: &str
) -> impl Future<Item = (DockerChain<C>, Image), Error = Error>
pub fn inspect_image(
self,
image_name: &str
) -> impl Future<Item = (DockerChain<C>, Image), Error = Error>
Inspect Image
Return low-level information about an image. Consumes the client instance.
Arguments
- Image name as a string slice.
Returns
- A Tuple containing the original DockerChain instance, and an Image, wrapped in a Future.
Examples
use std::default::Default;
docker.chain().inspect_image("hello-world");
sourcepub fn list_images<T, K>(
self,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, Vec<APIImages>), Error = Error>where
T: ListImagesQueryParams<K>,
K: AsRef<str>,
pub fn list_images<T, K>(
self,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, Vec<APIImages>), Error = Error>where
T: ListImagesQueryParams<K>,
K: AsRef<str>,
List Images
Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image. Consumes the client instance.
Arguments
- An optional List Images Options struct.
Returns
- A Tuple containing the original DockerChain instance, and a Vector of APIImages, wrapped in a Future.
Examples
use bollard::image::ListImagesOptions;
use std::collections::HashMap;
use std::default::Default;
let mut filters = HashMap::new();
filters.insert("dangling", "true");
let options = Some(ListImagesOptions{
all: true,
filters: filters,
..Default::default()
});
docker.chain().list_images(options);
sourcepub fn image_history(
self,
image_name: &str
) -> impl Future<Item = (DockerChain<C>, Vec<ImageHistory>), Error = Error>
pub fn image_history(
self,
image_name: &str
) -> impl Future<Item = (DockerChain<C>, Vec<ImageHistory>), Error = Error>
Image History
Return parent layers of an image. Consumes the client instance.
Arguments
- Image name as a string slice.
Returns
- A Tuple containing the original DockerChain instance, and a Vector of Image History Results, wrapped in a Future.
Examples
docker.chain().image_history("hello-world");
sourcepub fn prune_images<T, K>(
self,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, PruneImagesResults), Error = Error>where
T: PruneImagesQueryParams<K>,
K: AsRef<str>,
pub fn prune_images<T, K>(
self,
options: Option<T>
) -> impl Future<Item = (DockerChain<C>, PruneImagesResults), Error = Error>where
T: PruneImagesQueryParams<K>,
K: AsRef<str>,
Prune Images
Delete unused images. Consumes the client instance.
Arguments
- An optional Prune Images Options struct.
Returns
- A Tuple containing the original DockerChain instance, and a Prune Images Results, wrapped in a Future.
Examples
use bollard::image::PruneImagesOptions;
use std::collections::HashMap;
let mut filters = HashMap::new();
filters.insert("until", "10m");
let options = Some(PruneImagesOptions {
filters: filters
});
docker.chain().prune_images(options);
sourcepub fn commit_container<T, K, V, Z>(
self,
options: T,
config: Config<Z>
) -> impl Future<Item = (DockerChain<C>, CommitContainerResults), Error = Error>where
T: CommitContainerQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
Z: AsRef<str> + Eq + Hash + Serialize,
pub fn commit_container<T, K, V, Z>(
self,
options: T,
config: Config<Z>
) -> impl Future<Item = (DockerChain<C>, CommitContainerResults), Error = Error>where
T: CommitContainerQueryParams<K, V>,
K: AsRef<str>,
V: AsRef<str>,
Z: AsRef<str> + Eq + Hash + Serialize,
Commit Container
Create a new image from a container.
Arguments
- Commit Container Options struct.
- Container Config struct.
Returns
- A Tuple containing the original DockerChain instance, and a Commit Container Results, wrapped in a Future.
Examples
use bollard::image::CommitContainerOptions;
use bollard::container::Config;
use std::default::Default;
let options = CommitContainerOptions{
container: "my-running-container",
pause: true,
..Default::default()
};
let config = Config::<String> {
..Default::default()
};
docker.chain().commit_container(options, config);
source§impl<C> DockerChain<C>where
C: Connect + Sync + 'static,
impl<C> DockerChain<C>where
C: Connect + Sync + 'static,
sourcepub fn version(
self
) -> impl Future<Item = (DockerChain<C>, Version), Error = Error>
pub fn version(
self
) -> impl Future<Item = (DockerChain<C>, Version), Error = Error>
Version
Returns the version of Docker that is running and various information about the system that Docker is running on. Consumes the client instance.
Returns
- A Tuple containing the original DockerChain instance, and a Version, wrapped in a Future.
Examples
docker.chain().version();
sourcepub fn ping(self) -> impl Future<Item = (DockerChain<C>, String), Error = Error>
pub fn ping(self) -> impl Future<Item = (DockerChain<C>, String), Error = Error>
Ping
This is a dummy endpoint you can use to test if the server is accessible. Consumes the client instance.
Returns
- A Tuple containing the original DockerChain instance, and a String, wrapped in a Future.
Examples
docker.chain().ping();
Trait Implementations§
source§impl<C> Clone for DockerChain<C>
impl<C> Clone for DockerChain<C>
source§fn clone(&self) -> DockerChain<C>
fn clone(&self) -> DockerChain<C>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more