public class BuildContext
extends java.lang.Object
implements java.io.Closeable
ContainerConfiguration
, ImageConfiguration
, and FileEntriesLayer
) held in are
immutable.Modifier and Type | Class and Description |
---|---|
static class |
BuildContext.Builder
Builds an immutable
BuildContext . |
Modifier and Type | Method and Description |
---|---|
static BuildContext.Builder |
builder()
Creates a new
BuildContext.Builder to build a BuildContext . |
void |
close() |
com.google.common.collect.ImmutableSet<java.lang.String> |
getAllTargetImageTags()
Returns all image tags configured for this build.
|
boolean |
getAlwaysCacheBaseImage()
Gets whether or not to force caching the base images.
|
Cache |
getApplicationLayersCache()
Gets the
Cache for application layers. |
ImageConfiguration |
getBaseImageConfiguration() |
Cache |
getBaseImageLayersCache()
Gets the
Cache for base image layers. |
ContainerConfiguration |
getContainerConfiguration() |
boolean |
getEnablePlatformTags() |
EventHandlers |
getEventHandlers() |
java.util.concurrent.ExecutorService |
getExecutorService() |
com.google.common.collect.ImmutableList<com.google.cloud.tools.jib.api.buildplan.FileEntriesLayer> |
getLayerConfigurations()
Gets the configurations for building the layers.
|
com.google.common.collect.ImmutableListMultimap<java.lang.String,java.lang.String> |
getRegistryMirrors()
Gets the registry mirrors.
|
java.lang.Class<? extends BuildableManifestTemplate> |
getTargetFormat() |
ImageConfiguration |
getTargetImageConfiguration() |
java.lang.String |
getToolName() |
java.lang.String |
getToolVersion() |
boolean |
isOffline()
Gets whether or not to run the build in offline mode.
|
RegistryClient.Factory |
newBaseImageRegistryClientFactory()
Creates a new
RegistryClient.Factory for the base image with fields from the build
configuration. |
RegistryClient.Factory |
newBaseImageRegistryClientFactory(java.lang.String serverUrl)
Creates a new
RegistryClient.Factory for the base image repository on the registry
serverUrl . |
RegistryClient.Factory |
newTargetImageRegistryClientFactory()
Creates a new
RegistryClient.Factory for the target image with fields from the build
configuration. |
public static BuildContext.Builder builder()
BuildContext.Builder
to build a BuildContext
.BuildContext.Builder
public ImageConfiguration getBaseImageConfiguration()
public boolean getEnablePlatformTags()
public ImageConfiguration getTargetImageConfiguration()
public com.google.common.collect.ImmutableSet<java.lang.String> getAllTargetImageTags()
public ContainerConfiguration getContainerConfiguration()
public java.lang.Class<? extends BuildableManifestTemplate> getTargetFormat()
public java.lang.String getToolName()
@Nullable public java.lang.String getToolVersion()
public EventHandlers getEventHandlers()
public java.util.concurrent.ExecutorService getExecutorService()
public Cache getBaseImageLayersCache()
Cache
for base image layers.Cache
for base image layerspublic Cache getApplicationLayersCache()
Cache
for application layers.Cache
for application layerspublic boolean isOffline()
true
if the build will run in offline mode; false
otherwisepublic boolean getAlwaysCacheBaseImage()
true
if the user wants to force the build to always pull the image layers.public com.google.common.collect.ImmutableList<com.google.cloud.tools.jib.api.buildplan.FileEntriesLayer> getLayerConfigurations()
public com.google.common.collect.ImmutableListMultimap<java.lang.String,java.lang.String> getRegistryMirrors()
public RegistryClient.Factory newBaseImageRegistryClientFactory()
RegistryClient.Factory
for the base image with fields from the build
configuration. The server URL is derived from the base ImageConfiguration
.RegistryClient.Factory
public RegistryClient.Factory newBaseImageRegistryClientFactory(java.lang.String serverUrl)
RegistryClient.Factory
for the base image repository on the registry
serverUrl
. Compared to @link #newBaseImageRegistryClientFactory()), this method is
useful to try a mirror.serverUrl
- the server URL for the registry (for example, gcr.io
)RegistryClient.Factory
public RegistryClient.Factory newTargetImageRegistryClientFactory()
RegistryClient.Factory
for the target image with fields from the build
configuration.RegistryClient.Factory
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException