brane_tsk::docker

Function ensure_image

Source
pub async fn ensure_image(
    docker: &Docker,
    image: impl Into<Image>,
    source: impl Into<ImageSource>,
) -> Result<(), Error>
Expand description

Tries to import/pull the given image if it does not exist in the local Docker instance.

§Arguments

  • docker: An already connected local instance of Docker.
  • image: The Docker image name, version & potential digest to pull.
  • source: Where to get the image from should it not be present already.

§Errors

This function errors if it failed to ensure the image existed (i.e., import or pull failed).