jib icon indicating copy to clipboard operation
jib copied to clipboard

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

Open Xirado opened this issue 1 year ago • 4 comments

Environment:

  • Jib version: 3.4.3
  • Build tool: Gradle 8.5
  • OS: Arch Linux x86_64, though it happens on Windows aswell

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 avatar Jul 03 '24 13:07 Xirado

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

Xirado avatar Jul 03 '24 13:07 Xirado

I am facing the same issue with version com.google.cloud.tools:jib-maven-plugin:3.4.3. When I downgrade to 3.4.2, everything works normal.

My output of docker info (actually I am running podman 3.4.2) is

host:
  arch: amd64
  os: linux
...
version:
  APIVersion: 3.4.2
  OsArch: linux/amd64
  Version: 3.4.2
``

giraone avatar Jul 11 '24 11:07 giraone

I can also confirm this.

$ docker info
Client: Docker Engine - Community
 Version:    27.0.3
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.15.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.28.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 27.0.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ae71819c4f5e67bb4d5ae76a6b735f29cc25774e
 runc version: v1.1.13-0-g58aa920
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.1.0-22-amd64
 Operating System: Debian GNU/Linux 12 (bookworm)
 OSType: linux
 Architecture: x86_64
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

The downgrade to 3.4.2 does also fix this for me as suggested by @giraone

pschichtel avatar Jul 11 '24 23:07 pschichtel

Thanks for filing this issue and apologies for the inconvenience! 3.4.3 explicitly throws an exception when the docker info stats don't match the os/arch of the image jib is trying to build to the local docker daemon. However, this PR should address the failure you are facing: https://github.com/GoogleContainerTools/jib/pull/4268 and will be included in the next release. For now, please continue using 3.4.2 if this is blocking you.

mpeddada1 avatar Jul 16 '24 20:07 mpeddada1

However, this PR should address the failure you are facing: https://github.com/GoogleContainerTools/jib/pull/4268 and will be included in the next release.

So has this been fixed with release 3.4.4, and can be closed?

sschuberth avatar Oct 21 '24 09:10 sschuberth

jib-maven-plugin 3.4.4 and jib-gradle-plugin 3.4.4 have been released (https://github.com/GoogleContainerTools/jib/releases) to address https://github.com/GoogleContainerTools/jib/issues/4265 and https://github.com/GoogleContainerTools/jib/issues/4265. Please let us know if you're running into any further issues!

mpeddada1 avatar Oct 29 '24 20:10 mpeddada1

jib-maven-plugin 3.4.4 and jib-gradle-plugin 3.4.4 have been released (https://github.com/GoogleContainerTools/jib/releases) to address #4265 and #4265.

The second issue should have probably said https://github.com/GoogleContainerTools/jib/issues/4283 (this issue), anyway thanks for confirming the fix!

sschuberth avatar Oct 30 '24 09:10 sschuberth