public interface DockerAccess
| Modifier and Type | Method and Description |
|---|---|
void |
buildImage(String image,
File dockerArchive,
BuildOptions options)
Create a docker image from a given archive
|
String |
getImageId(String name)
Get the image id of a given name or
null if no such image exists |
boolean |
hasImage(String name)
Check whether the given name exists as image at the docker daemon
|
void |
loadImage(String image,
File tarArchive)
Load an image from an archive.
|
void |
pullImage(String image,
AuthConfig authConfig,
String registry,
CreateImageOptions options)
Pull an image from a remote registry and store it locally.
|
void |
pushImage(String image,
AuthConfig authConfig,
String registry,
int retries)
Push an image to a registry.
|
boolean |
removeImage(String image,
boolean... force)
Remove an image from this docker installation
|
void |
saveImage(String image,
String filename,
org.eclipse.jkube.kit.common.archive.ArchiveCompression compression)
Save an image to a tar file
|
void |
shutdown()
Lifecycle method which must be called when this object is not needed anymore.
|
void |
start()
Lifecycle method for this access class which must be called before any other method is called.
|
void |
tag(String sourceImage,
String targetImage,
boolean force)
Alias an image in the repository with a complete new name.
|
boolean hasImage(String name) throws DockerAccessException
name - image name to checkDockerAccessException - docker access exceptionString getImageId(String name) throws DockerAccessException
null if no such image existsname - name to lookupnullDockerAccessException - docker access exceptionvoid loadImage(String image, File tarArchive) throws DockerAccessException
image - the image to pull.tarArchive - archive fileDockerAccessException - if the image couldn't be loaded.void pullImage(String image, AuthConfig authConfig, String registry, CreateImageOptions options) throws DockerAccessException
image - the image to pull.authConfig - authentication configuration used when pulling an imageregistry - an optional registry from where to pull the image. Can be null.options - additional query arguments to add when creating the image. Can be null.DockerAccessException - if the image couldn't be pulled.void pushImage(String image, AuthConfig authConfig, String registry, int retries) throws DockerAccessException
image - image name to pushauthConfig - authentication configurationregistry - optional registry to which the image should be pushed.retries - optional number of times the push should be retried on a 500 errorDockerAccessException - in case pushing failsvoid buildImage(String image, File dockerArchive, BuildOptions options) throws DockerAccessException
image - name of the image to build or null if none should be useddockerArchive - from which the docker image should be buildoptions - additional query arguments to add when building the image. Can be null.DockerAccessException - if docker host reports an error during building of an imagevoid tag(String sourceImage, String targetImage, boolean force) throws DockerAccessException
sourceImage - full name (including tag) of the image to aliastargetImage - the alias nameforce - forced taggingDockerAccessException - if the original image doesn't exist or another error occurs somehow.boolean removeImage(String image, boolean... force) throws DockerAccessException
image - image to removeforce - if set to true remove containers as well (only the first vararg is evaluated)DockerAccessException - if an image cannot be removedvoid saveImage(String image, String filename, org.eclipse.jkube.kit.common.archive.ArchiveCompression compression) throws DockerAccessException
image - image to savefilename - target filenamecompression - compression to use for the archiveDockerAccessException - if an image cannot be removedvoid start()
throws DockerAccessException
DockerAccessException - docker access exceptionvoid shutdown()
Copyright © 2024. All rights reserved.