GoogleContainerTools / jib

🏗 Build container images for your Java applications.
Apache License 2.0
13.5k stars 1.42k forks source link

The configured platforms don't match the Docker Engine's OS and architecture #4283

Open Xirado opened 6 days ago

Xirado commented 6 days ago

Environment:

Description of the issue: When running ./gradlew jibDockerBuild i get this error:

 Execution failed for task ':jibDockerBuild'.
> com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: The configured platforms don't match the Docker Engine's OS and architecture (/)
Caused by: com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: The configured platforms don't match the Docker Engine's OS and architecture (/)
    at com.google.cloud.tools.jib.plugins.common.JibBuildRunner.runBuild(JibBuildRunner.java:285)
    at com.google.cloud.tools.jib.gradle.BuildDockerTask.buildDocker(BuildDockerTask.java:126)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
    ... 118 more
Caused by: java.lang.IllegalStateException: The configured platforms don't match the Docker Engine's OS and architecture (/)
    at com.google.common.base.Preconditions.checkState(Preconditions.java:512)
    at com.google.cloud.tools.jib.builder.steps.StepsRunner.lambda$loadDocker$18(StepsRunner.java:628)
    at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131)
    at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:75)
    at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)

Expected behavior: The image should be built and pushed to the local docker daemon

Steps to reproduce: I don't know how to reproduce this 100%, i've had it work before, and fail the next day, the OS doesn't seem to matter since i've had it happen on both windows and linux.

jib-gradle-plugin Configuration:

jib.to.image = "xirado/bot-template"

Log output: Above

Xirado commented 6 days ago

At first i thought this is related to #4265 but the error message seems to suggest the os and architecture from docker info is just empty, though i've myself checked and running it in the terminal returns desired results:

[marcel@archbtw ~]$ docker info
Client:
 Version:    26.1.4
 Context:    default
 Debug Mode: false

Server:
 ...
 Kernel Version: 6.9.7-arch1-1
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 31.27GiB
 Name: archbtw
 ID: 68c963e8-9170-45dc-9efc-ba0092766782
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false