public class Containerizer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.nio.file.Path |
DEFAULT_BASE_CACHE_DIRECTORY
The default directory for caching the base image layers, in
[user cache
home]/google-cloud-tools-java/jib . |
Modifier and Type | Method and Description |
---|---|
Containerizer |
setAllowInsecureRegistries(boolean allowInsecureRegistries)
Sets whether or not to allow communication over HTTP/insecure HTTPS.
|
Containerizer |
setApplicationLayersCache(java.nio.file.Path cacheDirectory)
Sets the directory to use for caching application layers.
|
Containerizer |
setBaseImageLayersCache(java.nio.file.Path cacheDirectory)
Sets the directory to use for caching base image layers.
|
Containerizer |
setEventHandlers(EventHandlers eventHandlers)
Sets the
EventHandlers to handle events dispatched during Jib's execution. |
Containerizer |
setExecutorService(java.util.concurrent.ExecutorService executorService)
Sets the
ExecutorService Jib executes on. |
Containerizer |
setToolName(java.lang.String toolName)
Sets the name of the tool that is using Jib Core.
|
static Containerizer |
to(DockerDaemonImage dockerDaemonImage)
Gets a new
Containerizer that containerizes to a Docker daemon. |
static Containerizer |
to(RegistryImage registryImage)
Gets a new
Containerizer that containerizes to a container registry. |
static Containerizer |
to(TarImage tarImage)
Gets a new
Containerizer that containerizes to a tarball archive. |
Containerizer |
withAdditionalTag(java.lang.String tag)
Adds an additional tag to tag the target image with.
|
public static final java.nio.file.Path DEFAULT_BASE_CACHE_DIRECTORY
[user cache
home]/google-cloud-tools-java/jib
.public static Containerizer to(RegistryImage registryImage)
Containerizer
that containerizes to a container registry.registryImage
- the RegistryImage
that defines target container registry and
credentialsContainerizer
public static Containerizer to(DockerDaemonImage dockerDaemonImage)
Containerizer
that containerizes to a Docker daemon.dockerDaemonImage
- the DockerDaemonImage
that defines target Docker daemonContainerizer
public static Containerizer to(TarImage tarImage)
Containerizer
that containerizes to a tarball archive.tarImage
- the TarImage
that defines target output fileContainerizer
public Containerizer withAdditionalTag(java.lang.String tag)
gcr.io/my-project/my-image:tag
and gcr.io/my-project/my-image:tag2
:
Containerizer.to(RegistryImage.named("gcr.io/my-project/my-image:tag")).withAdditionalTag("tag2");
tag
- the additional tag to push topublic Containerizer setExecutorService(@Nullable java.util.concurrent.ExecutorService executorService)
ExecutorService
Jib executes on. Jib, by default, uses Executors.newCachedThreadPool()
.executorService
- the ExecutorService
public Containerizer setBaseImageLayersCache(java.nio.file.Path cacheDirectory)
[user cache
home]/google-cloud-tools-java/jib
(DEFAULT_BASE_CACHE_DIRECTORY
. This directory can
be the same directory used for setApplicationLayersCache(java.nio.file.Path)
.cacheDirectory
- the cache directorypublic Containerizer setApplicationLayersCache(java.nio.file.Path cacheDirectory)
setBaseImageLayersCache(java.nio.file.Path)
.cacheDirectory
- the cache directorypublic Containerizer setEventHandlers(EventHandlers eventHandlers)
EventHandlers
to handle events dispatched during Jib's execution.eventHandlers
- the EventHandlers
public Containerizer setAllowInsecureRegistries(boolean allowInsecureRegistries)
allowInsecureRegistries
- if true
, insecure connections will be allowedpublic Containerizer setToolName(java.lang.String toolName)
User-Agent
in registry requests and set as the created_by
in the container layer
history. Defaults to jib-core
.toolName
- the name of the tool using this library