Class BuildContext.Builder

    • Method Detail

      • setEnablePlatformTags

        public BuildContext.Builder setEnablePlatformTags​(boolean enablePlatformTags)
        Sets whether to automatically add architecture suffix to tags for platform-specific images when building multi-platform images. For example, when building amd64 and arm64 images for a given tag, the final tags will be <tag>-amd64 and <tag>-arm64.
        Parameters:
        enablePlatformTags - whether to append architecture suffix to tags
        Returns:
        this
      • setApplicationLayersCacheDirectory

        public BuildContext.Builder setApplicationLayersCacheDirectory​(java.nio.file.Path applicationLayersCacheDirectory)
        Sets the location of the cache for storing application layers.
        Parameters:
        applicationLayersCacheDirectory - the application layers cache directory
        Returns:
        this
      • setBaseImageLayersCacheDirectory

        public BuildContext.Builder setBaseImageLayersCacheDirectory​(java.nio.file.Path baseImageLayersCacheDirectory)
        Sets the location of the cache for storing base image layers.
        Parameters:
        baseImageLayersCacheDirectory - the base image layers cache directory
        Returns:
        this
      • setTargetFormat

        public BuildContext.Builder setTargetFormat​(com.google.cloud.tools.jib.api.buildplan.ImageFormat targetFormat)
        Sets the target format of the container image.
        Parameters:
        targetFormat - the target format
        Returns:
        this
      • setAllowInsecureRegistries

        public BuildContext.Builder setAllowInsecureRegistries​(boolean allowInsecureRegistries)
        Sets whether or not to allow communication over HTTP (as opposed to HTTPS).
        Parameters:
        allowInsecureRegistries - if true, insecure connections will be allowed
        Returns:
        this
      • setOffline

        public BuildContext.Builder setOffline​(boolean offline)
        Sets whether or not to perform the build in offline mode.
        Parameters:
        offline - if true, the build will run in offline mode
        Returns:
        this
      • setAlwaysCacheBaseImage

        public BuildContext.Builder setAlwaysCacheBaseImage​(boolean alwaysCacheBaseImage)
        Controls the optimization which skips downloading base image layers that exist in a target registry. If the user does not set this property then read as false.
        Parameters:
        alwaysCacheBaseImage - if true, base image layers are always pulled and cached. If false, base image layers will not be pulled/cached if they already exist on the target registry.
        Returns:
        this
      • setLayerConfigurations

        public BuildContext.Builder setLayerConfigurations​(java.util.List<com.google.cloud.tools.jib.api.buildplan.FileEntriesLayer> layerConfigurations)
        Sets the layers to build.
        Parameters:
        layerConfigurations - the configurations for the layers
        Returns:
        this
      • setToolName

        public BuildContext.Builder setToolName​(java.lang.String toolName)
        Sets the name of the tool that is executing the build.
        Parameters:
        toolName - the tool name
        Returns:
        this
      • setToolVersion

        public BuildContext.Builder setToolVersion​(@Nullable
                                                   java.lang.String toolVersion)
        Sets the version of the tool that is executing the build.
        Parameters:
        toolVersion - the tool version
        Returns:
        this
      • setExecutorService

        public BuildContext.Builder setExecutorService​(@Nullable
                                                       java.util.concurrent.ExecutorService executorService)
        Sets the ExecutorService Jib executes on. By default, Jib uses Executors.newCachedThreadPool().
        Parameters:
        executorService - the ExecutorService
        Returns:
        this
      • setRegistryMirrors

        public BuildContext.Builder setRegistryMirrors​(com.google.common.collect.ListMultimap<java.lang.String,​java.lang.String> registryMirrors)
        Sets the registry mirrors.
        Parameters:
        registryMirrors - registry mirrors
        Returns:
        this