GoogleContainerTools/jib · error · GradleException

invalid value for containerizingMode: ${ex.getInvalidContain

Error message

invalid value for containerizingMode: ${ex.getInvalidContainerizingMode()}

What it means

Jib only accepts specific containerizingMode values (currently 'exploded' and 'packaged') and throws InvalidContainerizingModeException for anything else when building via jibBuildTar; the Gradle task wraps it with this message showing the invalid value.

Source

Thrown at jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildTarTask.java:151

            jibExtension.getConfigurationName().get());
    GlobalConfig globalConfig = GlobalConfig.readConfig();
    Future<Optional<String>> updateCheckFuture =
        TaskCommon.newUpdateChecker(projectProperties, globalConfig, getLogger());
    try {
      PluginConfigurationProcessor.createJibBuildRunnerForTarImage(
              new GradleRawConfiguration(jibExtension),
              ignored -> Optional.empty(),
              projectProperties,
              globalConfig,
              new GradleHelpfulSuggestions(HELPFUL_SUGGESTIONS_PREFIX))
          .runBuild();

    } catch (InvalidAppRootException ex) {
      throw new GradleException(
          "container.appRoot is not an absolute Unix-style path: " + ex.getInvalidPathValue(), ex);

    } catch (InvalidContainerizingModeException ex) {
      throw new GradleException(
          "invalid value for containerizingMode: " + ex.getInvalidContainerizingMode(), ex);

    } catch (InvalidWorkingDirectoryException ex) {
      throw new GradleException(
          "container.workingDirectory is not an absolute Unix-style path: "
              + ex.getInvalidPathValue(),
          ex);
    } catch (InvalidPlatformException ex) {
      throw new GradleException(
          "from.platforms contains a platform configuration that is missing required values or has invalid values: "
              + ex.getMessage()
              + ": "
              + ex.getInvalidPlatform(),
          ex);

    } catch (InvalidContainerVolumeException ex) {
      throw new GradleException(
          "container.volumes is not an absolute Unix-style path: " + ex.getInvalidVolume(), ex);

View on GitHub (pinned to fb949e2676)

Solutions

  1. Set containerizingMode to a supported value: 'exploded' or 'packaged', e.g. jib { containerizingMode = 'exploded' }
  2. Check the installed Jib Gradle plugin version documents the value you used (upgrade the plugin if the mode is newer than your version)
  3. Remove the containerizingMode line to fall back to the default mode

Example fix

// before
jib { containerizingMode = 'explode' }
// after
jib { containerizingMode = 'exploded' }
Defensive patterns

Strategy: validation

Validate before calling

def mode = project.jib.containerizingMode.getOrElse('exploded')
def allowed = ['exploded', 'packaged']
if (!allowed.contains(mode)) throw new GradleException("Invalid containerizingMode '$mode'; allowed: $allowed")

Prevention

When it happens

Trigger: Running gradle jibBuildTar with jib { containerizingMode = 'explode' } or any typo'd/unsupported mode string in the jib extension configuration.

Common situations: Typo like 'exploded' vs 'explode'; copying a mode value from Maven docs spelled differently; older Jib plugin versions that lack the containerizingMode option entirely (setting it on a plugin that ignores/then rejects it).

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06). Data as JSON: /api/errors/c5739874e2cdb84f. Report an issue: GitHub.