pub struct Container<'a, 'b> { /* private fields */ }Expand description
Interface for accessing and manipulating a docker container
Implementations§
Source§impl<'a, 'b> Container<'a, 'b>
impl<'a, 'b> Container<'a, 'b>
Sourcepub fn new<S>(docker: &'a Docker, id: S) -> Container<'a, 'b>
pub fn new<S>(docker: &'a Docker, id: S) -> Container<'a, 'b>
Exports an interface exposing operations against a container instance
Sourcepub fn inspect(&self) -> impl Future<Item = ContainerDetails, Error = Error>
pub fn inspect(&self) -> impl Future<Item = ContainerDetails, Error = Error>
Inspects the current docker container instance’s details
Sourcepub fn top(
&self,
psargs: Option<&str>,
) -> impl Future<Item = Top, Error = Error>
pub fn top( &self, psargs: Option<&str>, ) -> impl Future<Item = Top, Error = Error>
Returns a top view of information about the container process
Sourcepub fn logs(
&self,
opts: &LogsOptions,
) -> impl Stream<Item = Chunk, Error = Error>
pub fn logs( &self, opts: &LogsOptions, ) -> impl Stream<Item = Chunk, Error = Error>
Returns a stream of logs emitted but the container instance
Sourcepub fn attach(&self) -> impl Future<Item = Multiplexed, Error = Error>
pub fn attach(&self) -> impl Future<Item = Multiplexed, Error = Error>
Attaches to a running container, returning a stream that can be used to interact with the standard IO streams.
Sourcepub fn attach_blocking(&self) -> Result<MultiplexedBlocking>
pub fn attach_blocking(&self) -> Result<MultiplexedBlocking>
Attaches to a running container, returning a stream that can be used to interact with the standard IO streams.
Sourcepub fn changes(&self) -> impl Future<Item = Vec<Change>, Error = Error>
pub fn changes(&self) -> impl Future<Item = Vec<Change>, Error = Error>
Returns a set of changes made to the container instance
Sourcepub fn export(&self) -> impl Stream<Item = Vec<u8>, Error = Error>
pub fn export(&self) -> impl Stream<Item = Vec<u8>, Error = Error>
Exports the current docker container into a tarball
Sourcepub fn stats(&self) -> impl Stream<Item = Stats, Error = Error>
pub fn stats(&self) -> impl Stream<Item = Stats, Error = Error>
Returns a stream of stats specific to this container instance
Sourcepub fn stop(
&self,
wait: Option<Duration>,
) -> impl Future<Item = (), Error = Error>
pub fn stop( &self, wait: Option<Duration>, ) -> impl Future<Item = (), Error = Error>
Stop the container instance
Sourcepub fn restart(
&self,
wait: Option<Duration>,
) -> impl Future<Item = (), Error = Error>
pub fn restart( &self, wait: Option<Duration>, ) -> impl Future<Item = (), Error = Error>
Restart the container instance
Sourcepub fn kill(
&self,
signal: Option<&str>,
) -> impl Future<Item = (), Error = Error>
pub fn kill( &self, signal: Option<&str>, ) -> impl Future<Item = (), Error = Error>
Kill the container instance
Sourcepub fn rename(&self, name: &str) -> impl Future<Item = (), Error = Error>
pub fn rename(&self, name: &str) -> impl Future<Item = (), Error = Error>
Rename the container instance
Sourcepub fn delete(&self) -> impl Future<Item = (), Error = Error>
pub fn delete(&self) -> impl Future<Item = (), Error = Error>
Delete the container instance
Use remove instead to use the force/v options.
Sourcepub fn remove(
&self,
opts: RmContainerOptions,
) -> impl Future<Item = (), Error = Error>
pub fn remove( &self, opts: RmContainerOptions, ) -> impl Future<Item = (), Error = Error>
Delete the container instance (todo: force/v)
Sourcepub fn exec(
&self,
opts: &ExecContainerOptions,
) -> impl Stream<Item = Chunk, Error = Error>
pub fn exec( &self, opts: &ExecContainerOptions, ) -> impl Stream<Item = Chunk, Error = Error>
Exec the specified command in the container
Sourcepub fn copy_from(
&self,
path: &Path,
) -> impl Stream<Item = Vec<u8>, Error = Error>
pub fn copy_from( &self, path: &Path, ) -> impl Stream<Item = Vec<u8>, Error = Error>
Copy a file/folder from the container. The resulting stream is a tarball of the extracted files.
If path is not an absolute path, it is relative to the container’s root directory. The
resource specified by path must exist. To assert that the resource is expected to be a
directory, path should end in / or /. (assuming a path separator of /). If path
ends in /. then this indicates that only the contents of the path directory should be
copied. A symlink is always resolved to its target.