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

Cross building docker images on M1 #1503

Closed
johanandren opened this issue Apr 21, 2022 · 0 comments · Fixed by #1527
Closed

Cross building docker images on M1 #1503

johanandren opened this issue Apr 21, 2022 · 0 comments · Fixed by #1527

Comments

@johanandren
Copy link

For the Akka Serverless/Kalix Scala SDK we have the need for users to be able to build amd64 docker images from other cpu architectures (in practice it's probably only Apple arm64).

We are currently considering doing this with a small config change (or well, hack) for the native plugin like so:

dockerBuildCommand := {
   if (sys.props("os.arch") != "amd64") {
     // use buildx with platform to build supported amd64 images on other CPU architectures
     // this may require that you have first run 'docker buildx create' to set docker buildx up
     dockerExecCommand.value ++ Seq("buildx", "build", "--platform=linux/amd64", "--load") ++ dockerBuildOptions.value :+ "."
   } else dockerBuildCommand.value
 }

But it would be neat if there was something built into the plugin, like a setting for target docker image CPU architecture. For reference the docker-maven-plugin has such a platform attribute: https://github.com/lightbend/kalix-jvm-sdk/pull/904/files#diff-b0a4b8103a7a2702f37b74133ac07b36b18ec5dfe4fa77ceede96708bfddb911R126

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

Successfully merging a pull request may close this issue.

1 participant