Skip to content

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

Description

@cbeach47

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions