public class Containerizer extends Object
| Modifier and Type | Field and Description |
|---|---|
static 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 |
|---|---|
<E extends JibEvent> |
addEventHandler(Class<E> eventType,
Consumer<? super E> eventConsumer)
|
Containerizer |
addEventHandler(Consumer<JibEvent> eventConsumer)
Adds the
eventConsumer to handle all JibEvent types. |
Containerizer |
setAllowInsecureRegistries(boolean allowInsecureRegistries)
Sets whether or not to allow communication over HTTP/insecure HTTPS.
|
Containerizer |
setApplicationLayersCache(Path cacheDirectory)
Sets the directory to use for caching application layers.
|
Containerizer |
setBaseImageLayersCache(Path cacheDirectory)
Sets the directory to use for caching base image layers.
|
Containerizer |
setExecutorService(ExecutorService executorService)
Sets the
ExecutorService Jib executes on. |
Containerizer |
setOfflineMode(boolean offline)
Sets whether or not to run the build in offline mode.
|
Containerizer |
setToolName(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(String tag)
Adds an additional tag to tag the target image with.
|
public static final 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
credentialsContainerizerpublic static Containerizer to(DockerDaemonImage dockerDaemonImage)
Containerizer that containerizes to a Docker daemon.dockerDaemonImage - the DockerDaemonImage that defines target Docker daemonContainerizerpublic static Containerizer to(TarImage tarImage)
Containerizer that containerizes to a tarball archive.tarImage - the TarImage that defines target output fileContainerizerpublic Containerizer withAdditionalTag(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 ExecutorService executorService)
ExecutorService Jib executes on. Jib, by default, uses Executors.newCachedThreadPool().executorService - the ExecutorServicepublic Containerizer setBaseImageLayersCache(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(Path cacheDirectory)
setBaseImageLayersCache(java.nio.file.Path).cacheDirectory - the cache directorypublic <E extends JibEvent> Containerizer addEventHandler(Class<E> eventType, Consumer<? super E> eventConsumer)
eventConsumer to handle the JibEvent with class eventType. The
order in which handlers are added is the order in which they are called when the event is
dispatched.
Note: Implementations of eventConsumer must be thread-safe.
E - the type of eventTypeeventType - the event type that eventConsumer should handleeventConsumer - the event handlerpublic Containerizer addEventHandler(Consumer<JibEvent> eventConsumer)
eventConsumer to handle all JibEvent types. See addEventHandler(Class, Consumer) for more details.eventConsumer - the event handlerpublic Containerizer setAllowInsecureRegistries(boolean allowInsecureRegistries)
allowInsecureRegistries - if true, insecure connections will be allowedpublic Containerizer setOfflineMode(boolean offline)
offline - if true, the build will run in offline modepublic Containerizer setToolName(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 libraryCopyright © 2019. All rights reserved.