Struct docker_api::api::image::Images

source ·
pub struct Images { /* private fields */ }
Expand description

Interface for Docker Images.Image>

Implementations§

source§

impl Images

source

pub fn new(docker: Docker) -> Self

Exports an interface for interacting with Docker Images.

source

pub fn get(&self, name: impl Into<Id>) -> Image

Returns a reference to a set of operations available to a specific Image.

source§

impl Images

source

pub async fn list(&self, opts: &ImageListOpts) -> Result<Vec<ImageSummary>>

Api Reference

List available Images.

source

pub async fn prune( &self, opts: &ImagePruneOpts ) -> Result<ImagePrune200Response>

Api Reference

Delete stopped/unused Images.

source

pub fn build<'docker>( &'docker self, opts: &ImageBuildOpts ) -> impl Stream<Item = Result<ImageBuildChunk>> + Unpin + 'docker

Api Reference

Builds a new image by reading a Dockerfile in a target directory. If speed is important consider using Image::build_par that utilizes parallel compression on big directories, to use it enable par-compression feature.

source

pub fn build_par<'docker>( &'docker self, opts: &ImageBuildOpts ) -> impl Stream<Item = Result<ImageBuildChunk>> + Unpin + 'docker

Api Reference

Builds a new image by reading a Dockerfile in a target directory. Uses parallel compression algorithm to speed up the execution. For a single-threaded version check Image::build.

source

pub async fn search<T>(&self, term: T) -> Result<ImageSearch200Response>where T: AsRef<str>,

Api Reference

Search for docker images by term.

source

pub fn pull<'docker>( &'docker self, opts: &PullOpts ) -> impl Stream<Item = Result<ImageBuildChunk>> + Unpin + 'docker

Api Reference

Pull and create a new docker images from an existing image.

source

pub fn export<'docker>( &'docker self, names: Vec<&str> ) -> impl Stream<Item = Result<Vec<u8>>> + 'docker

Api Reference

Exports a collection of named images, either by name, name:tag, or image id, into a tarball.

source

pub fn import<'docker, R>( &'docker self, tarball: R ) -> impl Stream<Item = Result<ImageBuildChunk>> + Unpin + 'dockerwhere R: Read + Send + 'docker,

Api Reference

Imports an image or set of images from a given tarball source. Source can be uncompressed on compressed via gzip, bzip2 or xz.

source

pub async fn push( &self, name: impl Into<Id>, opts: &ImagePushOpts ) -> Result<()>

Api Reference

Push an image to registry.

source

pub async fn clear_cache( &self, opts: &ClearCacheOpts ) -> Result<BuildPrune200Response>

Api Reference

Clear image build cache.

Trait Implementations§

source§

impl Debug for Images

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Images

§

impl Send for Images

§

impl Sync for Images

§

impl Unpin for Images

§

impl !UnwindSafe for Images

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more