GoogleContainerTools/jib · warning

Detected multi-platform configuration, only building image t

Error message

Detected multi-platform configuration, only building image that matches the local Docker Engine's os and architecture (%s/%s) or the first platform specified

What it means

When building straight to a local Docker daemon, Jib can only produce one image matching the daemon's os/architecture. If the configuration specifies multiple platforms, Jib logs this warning and builds only the platform matching the local Docker Engine (or the first specified), ignoring the rest.

Source

Thrown at jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/StepsRunner.java:673

  @VisibleForTesting
  String normalizeArchitecture(String architecture) {
    // Create mapping based on https://docs.docker.com/engine/install/#supported-platforms
    if (architecture.equals("x86_64")) {
      return "amd64";
    } else if (architecture.equals("aarch64")) {
      return "arm64";
    }
    return architecture;
  }

  @VisibleForTesting
  Image fetchBuiltImageForLocalBuild(
      String osType, String architecture, EventHandlers eventHandlers)
      throws InterruptedException, ExecutionException {
    if (results.baseImagesAndBuiltImages.get().size() > 1) {
      eventHandlers.dispatch(
          LogEvent.warn(
              String.format(
                  "Detected multi-platform configuration, only building image that matches the local Docker Engine's os and architecture (%s/%s) or "
                      + "the first platform specified",
                  osType, architecture)));
      for (Map.Entry<Image, Future<Image>> imageEntry :
          results.baseImagesAndBuiltImages.get().entrySet()) {
        Image image = imageEntry.getValue().get();
        if (image.getArchitecture().equals(architecture) && image.getOs().equals(osType)) {
          return image;
        }
      }
    }
    return results.baseImagesAndBuiltImages.get().values().iterator().next().get();
  }
}

View on GitHub (pinned to fb949e2676)

Solutions

  1. Use `jib:build` (build to a registry) instead of `jib:dockerBuild` to produce a true multi-platform manifest
  2. Keep only the single platform matching the local Docker Engine if a local build is required
  3. Load each platform separately with `jib:dockerBuild -Djib.platform` per architecture if local images are needed

Example fix

// before
mvn jib:dockerBuild   // with platforms amd64+arm64 -> warning, single image
// after
mvn jib:build         // multi-platform manifest pushed to registry
Defensive patterns

Strategy: fallback

Validate before calling

// In Maven POM, only use multiple platforms with jib:build
// Guard in CI: if dockerBuild is used, assert single platform
grep -q '<platform>' pom.xml && ! mvn -q jib:help -Dgoal=dockerBuild >/dev/null 2>&1 && echo "use jib:build for multi-platform"

Prevention

When it happens

Trigger: StepsRunner.fetchBuiltImageForLocalBuild sees results.baseImagesAndBuiltImages.size() > 1 (a multi-platform jib.platforms configuration) during a `jib:dockerBuild` / jib DockerBuild request, dispatches this LogEvent.warn, then selects the image matching the given osType/architecture.

Common situations: Users configure <platforms> with linux/amd64 plus linux/arm64 expecting a multi-arch manifest via dockerBuild; multi-platform only works with `jib:build` (registry push), not local Docker builds.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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