docker-maven-plugin icon indicating copy to clipboard operation
docker-maven-plugin copied to clipboard

The platform property introduced in 0.42.0 changes the default behaviour

Open stickycode opened this issue 1 year ago • 0 comments

Description

When using the start goal on multiple platforms for an image that has only one platform, previously docker would figure out to emulate (on macos) images as needed.

With the introduction of the --platform parameter it now defaults to the native platform, that means if there is an image in the build that used to start and an m2 mac would figure out there wasn't an arm64 and just run the amd64 image. Now the build fails.

Why not just not set the platform if it's not set to preserve the old behaviour.

Info

  • docker-maven-plugin version : 0.42.0, 0.42.1, 0.43.0
  • Maven version (mvn -v) :
Apache Maven 3.9.2 (c9616018c7a021c1c39be70fb2843d6f5f9b8a1c)
Maven home: /home/xxx/local/apache-maven-3.9.2
Java version: 17.0.7, vendor: Private Build, runtime: /usr/lib/jvm/java-17-openjdk-amd64
Default locale: en_xx, platform encoding: UTF-8
OS name: "linux", version: "6.2.0-20-generic", arch: "amd64", family: "unix"

  • Docker version : any docker version (currently Docker version 20.10.21, build 20.10.21-0ubuntu3)

  • If it's a bug, how to reproduce :

    All you need to do is have a start rule for an image that does not have the version that matches the your native platform. So if you try to start an amd64 image on arm64.

    Where the user does not explicitly define the platform the platform property could just not be set leaving the docker implementation to figure it out as appropriate.

  • If it's a feature request, what is your use case : I think its a bug but the use case is that we have standard images which are amd64 because the CD environments are all amd64. But we have users with m1/m2 macs and they build projects locally to test the images to ensure they are working. Automated tests that also run in CI. The macs via Docker Desktop have an emulation layer to allow them to run amd64 images if that is all that is available when docker is asked to start it.

stickycode avatar Jun 13 '23 03:06 stickycode