GoogleContainerTools / jib

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

feat: determine platform details from local docker installation for jibDockerBuild #4249

Closed mpeddada1 closed 6 months ago

mpeddada1 commented 6 months ago

This code has been tested manually with jib/examples/helloworld/.

Notes:

<platforms>
                <platform>
                  <architecture>arm64</architecture>
                  <os>linux</os>
                </platform>
                <platform>
                  <architecture>amd64</architecture>
                  <os>linux</os>
                </platform>
 </platforms>
profhenry commented 3 months ago

I think this feature does not work with podman, did you test or consider this?

When using podman the docker info command output differs :-/. It returns

{
  "host": {
    "arch": "amd64",
    "buildahVersion": "1.23.0",
    "cgroupManager": "systemd",
    "cgroupVersion": "v2",
    "cgroupControllers": [],

Please also see: https://docs.podman.io/en/latest/markdown/podman-info.1.html

So determining os and architecture fails and you get "The configured platforms don't match the Docker Engine's OS and architecture (/). It would be nice if we could support podman as well.

profhenry commented 3 months ago

In addition this feature is also enabled when having just one single platform specified.

Even when specifying

<platforms>
  <platform>
    <architecture>amd64</architecture>
    <os>linux</os>
  </platform>
</platforms>

there is no need for this new feature. But it kicks in and fails the build when using podman. How can i disable this feature? This leaves Jib is no longer usable with podman :-/

chanseokoh commented 3 months ago

@profhenry #4265