Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker fails to run on AMD machines when built on Mac M1 machines #597

Open
cbeach47 opened this issue Oct 31, 2022 · 0 comments
Open

docker fails to run on AMD machines when built on Mac M1 machines #597

cbeach47 opened this issue Oct 31, 2022 · 0 comments

Comments

@cbeach47
Copy link
Contributor

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:

  1. On a Mac M1, run gradlew tomcatInstall, gradlew tomcatDeploy, gradlew dockerBuildImageWeb
  2. Via docker image inspect, search for 'Architecture' - it'll contain ARM (as expected)
  3. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant