Describe the bug
When the gradle task dockerBuildImageWeb is run on a Mac M1, it succeeds, but then fails to run on an AMD architecture (such on a Linux distro). This is expected, however, the gradle plugin does not appear to honor the platform flag, such as --platform=linux/amd64. Using the same dockerfile outside of the gradle build, and with the platform flag, the docker image can build on a Mac M1, and run on a Linux distro.
The gradle task should support building on Mac M1, and running on a different platform. It would be sufficient to adjust the dockerfile, but the gradle task should still be the launch point for the docker build.
To Reproduce
Steps to reproduce the behavior:
- On a Mac M1, run
gradlew tomcatInstall, gradlew tomcatDeploy, gradlew dockerBuildImageWeb
- Via
docker image inspect, search for 'Architecture' - it'll contain ARM (as expected)
- There is no known way to adjust the
dockerfile with the platform flag, nor to pass it in as a variable / parameter that will build so the 'Architecture' contains AMD.
Expected behavior
There should be a straight forward path to build the docker image on a Mac M1, and target a different platform.
Describe the bug
When the gradle task
dockerBuildImageWebis run on a Mac M1, it succeeds, but then fails to run on an AMD architecture (such on a Linux distro). This is expected, however, the gradle plugin does not appear to honor the platform flag, such as--platform=linux/amd64. Using the samedockerfileoutside of the gradle build, and with the platform flag, the docker image can build on a Mac M1, and run on a Linux distro.The gradle task should support building on Mac M1, and running on a different platform. It would be sufficient to adjust the dockerfile, but the gradle task should still be the launch point for the docker build.
To Reproduce
Steps to reproduce the behavior:
gradlew tomcatInstall,gradlew tomcatDeploy,gradlew dockerBuildImageWebdocker image inspect, search for 'Architecture' - it'll containARM(as expected)dockerfilewith theplatformflag, nor to pass it in as a variable / parameter that will build so the 'Architecture' containsAMD.Expected behavior
There should be a straight forward path to build the docker image on a Mac M1, and target a different platform.