pub struct Docker { /* private fields */ }Expand description
The local Docker Engine.
Implementations§
Source§impl Docker
impl Docker
Sourcepub fn connect() -> Result<Docker, Error>
pub fn connect() -> Result<Docker, Error>
Connects to the Docker Engine at DOCKER_HOST, or its local socket. Only unix:// hosts are supported.
Sourcepub async fn info(&self) -> Result<SystemInfo, Error>
pub async fn info(&self) -> Result<SystemInfo, Error>
The Engine’s system information.
Trait Implementations§
Source§impl DockerApi for Docker
impl DockerApi for Docker
Source§async fn start(
&self,
spec: &RunnerSpec,
isolation: &dyn Isolation,
) -> Result<String, Error>
async fn start( &self, spec: &RunnerSpec, isolation: &dyn Isolation, ) -> Result<String, Error>
Creates and starts a runner container; returns its ID.
Source§async fn inspect(&self, container: &str) -> Result<RunnerState, Error>
async fn inspect(&self, container: &str) -> Result<RunnerState, Error>
A container’s state and isolation.
Source§async fn remove(&self, container: &str) -> Result<(), Error>
async fn remove(&self, container: &str) -> Result<(), Error>
Removes a runner container, stopping it first if it runs.
Source§async fn run(
&self,
name: &str,
body: ContainerCreateBody,
) -> Result<String, Error>
async fn run( &self, name: &str, body: ContainerCreateBody, ) -> Result<String, Error>
Creates and starts a container that is not a runner, such as the mirror; returns its ID.
Source§async fn list(&self, label: &str) -> Result<Vec<Container>, Error>
async fn list(&self, label: &str) -> Result<Vec<Container>, Error>
Every container, running or not, that has the label.
Source§async fn wait(&self, container: &str) -> Result<i64, Error>
async fn wait(&self, container: &str) -> Result<i64, Error>
Waits for a container to exit; returns its exit code.
Source§async fn logs(&self, container: &str) -> Result<String, Error>
async fn logs(&self, container: &str) -> Result<String, Error>
A container’s output so far, stdout and stderr interleaved.
Source§async fn logs_since(&self, container: &str, since: u64) -> Result<String, Error>
async fn logs_since(&self, container: &str, since: u64) -> Result<String, Error>
A container’s output since
since (seconds since the epoch), each line prefixed with Docker’s RFC 3339
timestamp and a space.Source§async fn exec(
&self,
container: &str,
command: Vec<String>,
) -> Result<Output, Error>
async fn exec( &self, container: &str, command: Vec<String>, ) -> Result<Output, Error>
Runs a command as root in a running container; its stdout streams until it exits or the container stops.
Its stderr is dropped.
Source§async fn image_present(&self, image: &str) -> Result<bool, Error>
async fn image_present(&self, image: &str) -> Result<bool, Error>
Whether Docker has an image.
Source§async fn pull(&self, image: &str) -> Result<(), Error>
async fn pull(&self, image: &str) -> Result<(), Error>
Pulls an image, logging its progress every few seconds.
Source§async fn ensure_network(&self, name: &str) -> Result<(), Error>
async fn ensure_network(&self, name: &str) -> Result<(), Error>
Creates a bridge network unless it exists.
Source§async fn ensure_volume(&self, name: &str) -> Result<(), Error>
async fn ensure_volume(&self, name: &str) -> Result<(), Error>
Creates a volume unless it exists.
Auto Trait Implementations§
impl !RefUnwindSafe for Docker
impl !UnwindSafe for Docker
impl Freeze for Docker
impl Send for Docker
impl Sync for Docker
impl Unpin for Docker
impl UnsafeUnpin for Docker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more