Class DockerApi.ImageApi
java.lang.Object
org.springframework.boot.buildpack.platform.docker.DockerApi.ImageApi
- Enclosing class:
- DockerApi
Docker API for image operations.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
exportLayerFiles
(ImageReference reference, IOBiConsumer<String, Path> exports) Deprecated, for removal: This API element is subject to removal in a future version.void
exportLayers
(ImageReference reference, IOBiConsumer<String, TarArchive> exports) Export the layers of an image asTarArchives
.inspect
(ImageReference reference) Inspect an image.void
load
(ImageArchive archive, UpdateListener<LoadImageUpdateEvent> listener) Load anImageArchive
into Docker.pull
(ImageReference reference, UpdateListener<PullImageUpdateEvent> listener) Pull an image from a registry.pull
(ImageReference reference, UpdateListener<PullImageUpdateEvent> listener, String registryAuth) Pull an image from a registry.void
push
(ImageReference reference, UpdateListener<PushImageUpdateEvent> listener, String registryAuth) Push an image to a registry.void
remove
(ImageReference reference, boolean force) Remove a specific image.void
tag
(ImageReference sourceReference, ImageReference targetReference)
-
Method Details
-
pull
public Image pull(ImageReference reference, UpdateListener<PullImageUpdateEvent> listener) throws IOException Pull an image from a registry.- Parameters:
reference
- the image reference to pulllistener
- a pull listener to receive update events- Returns:
- the
pulled image
instance - Throws:
IOException
- on IO error
-
pull
public Image pull(ImageReference reference, UpdateListener<PullImageUpdateEvent> listener, String registryAuth) throws IOException Pull an image from a registry.- Parameters:
reference
- the image reference to pulllistener
- a pull listener to receive update eventsregistryAuth
- registry authentication credentials- Returns:
- the
pulled image
instance - Throws:
IOException
- on IO error
-
push
public void push(ImageReference reference, UpdateListener<PushImageUpdateEvent> listener, String registryAuth) throws IOException Push an image to a registry.- Parameters:
reference
- the image reference to pushlistener
- a push listener to receive update eventsregistryAuth
- registry authentication credentials- Throws:
IOException
- on IO error
-
load
public void load(ImageArchive archive, UpdateListener<LoadImageUpdateEvent> listener) throws IOException Load anImageArchive
into Docker.- Parameters:
archive
- the archive to loadlistener
- a pull listener to receive update events- Throws:
IOException
- on IO error
-
exportLayerFiles
@Deprecated(since="3.2.6", forRemoval=true) public void exportLayerFiles(ImageReference reference, IOBiConsumer<String, Path> exports) throws IOExceptionDeprecated, for removal: This API element is subject to removal in a future version.since 3.2.6 for removal in 3.5.0 in favor ofexportLayers(ImageReference, IOBiConsumer)
Export the layers of an image as paths to layer tar files.- Parameters:
reference
- the reference to exportexports
- a consumer to receive the layer tar file paths (file can only be accessed during the callback)- Throws:
IOException
- on IO error- Since:
- 2.7.10
-
exportLayers
public void exportLayers(ImageReference reference, IOBiConsumer<String, TarArchive> exports) throws IOExceptionExport the layers of an image asTarArchives
.- Parameters:
reference
- the reference to exportexports
- a consumer to receive the layers (contents can only be accessed during the callback)- Throws:
IOException
- on IO error
-
remove
Remove a specific image.- Parameters:
reference
- the reference the removeforce
- if removal should be forced- Throws:
IOException
- on IO error
-
inspect
Inspect an image.- Parameters:
reference
- the image reference- Returns:
- the image from the local repository
- Throws:
IOException
- on IO error
-
tag
- Throws:
IOException
-
exportLayers(ImageReference, IOBiConsumer)