Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiplatform build should fail when base image not available for a specified platform #3563

Closed
anuraaga opened this issue Jan 20, 2022 · 2 comments · Fixed by #3707
Closed

Comments

@anuraaga
Copy link
Contributor

Environment:

  • Jib version: 3.2.0
  • Build tool: Gradle
  • OS: Linux

Description of the issue:

Build silently ignores platforms that have been defined but the base image doesn't support.

Expected behavior:

Build should fail when a platform isn't available. docker buildx does so, i.e.
error: failed to solve: amazoncorretto:17-alpine-jdk: no match for platform in manifest sha256:07d678945d7c61706739add66331f7bd4bd5e290aa6e0c7cbefc9379ac86b225: not found

Steps to reproduce:

  1. ./gradlew jib with configuration like below

jib-gradle-plugin Configuration:

jib {
  to {
    image = "someimage"
  }
  from {
    // Any image that doesn't support arm64
    image = "amazoncorretto:17-alpine-jdk"
    platforms {
      platform {
        architecture = "amd64"
        os = "linux"
      }
      platform {
        architecture = "arm64"
        os = "linux"
      }
    }
  }
}

In our project, we added the platforms block expecting arm64 but found it to only support amd64

docker manifest inspect -v public.ecr.aws/aws-otel-test/aws-otel-java-spark:66141a5e34a68c1954f535ac5105457514917d5a

After some thunking, finally realized that the base image also needed to be updated for arm64

After adding to our base image

aws-observability/aws-otel-java-instrumentation@891a9f6

the image now has arm64 support as well

docker manifest inspect -v public.ecr.aws/aws-otel-test/aws-otel-java-spark:891a9f603414b0d02028ee21a4ce392015f352c8

Failing fast, like buildx, will make it easier / quicker to find such an issue.

@blakeli0
Copy link
Contributor

@anuraaga Thanks for the feedback, feel free to contribute as well and we'll be happy to accept your contributions!

@mpeddada1
Copy link
Contributor

Thank you for improving our error messaging @gsquared94! jib-gradle-plugin 3.3.0 and jib-maven-plugin 3.3.0 have been released with this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants