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

multi-architecture docker image #3542

Open
denisa opened this issue May 15, 2023 · 4 comments
Open

multi-architecture docker image #3542

denisa opened this issue May 15, 2023 · 4 comments

Comments

@denisa
Copy link

denisa commented May 15, 2023

please provide a docker image that works natively on amd64 and arm64 architecture.

Since the release of Apple’s m1-based macs, this architecture is more common and, while possible, executing amd64 image on them is not optimal

@ag91
Copy link

ag91 commented Jul 9, 2023

hey, just gave a look at this issue out of curiosity. According to https://docs.docker.com/build/ci/github-actions/multi-platform/, this could be solved with just a line added here :

          platforms: linux/amd64,linux/arm64, darwin/amd64,darwin/arm64

Not sure if that does the trick (didn't test), but I thought my little research could be useful.

@denisa
Copy link
Author

denisa commented Jul 12, 2023

That’s probably not enough: this would copy the same binary built on GitHub onto all these images, eg they would all have the same scalafmt-linux-musl

@ag91
Copy link

ag91 commented Jul 12, 2023

good point! It seems the scalafmt-macos is created already here.
So I guess that may just need an if else in the Dockerfile to copy the right binary file (or even move them both?)

@denisa
Copy link
Author

denisa commented Aug 6, 2023

I’ve generally seen (and used) multi-phase docker images: a first phase builds the binary from scratch in a docker images, while a 2nd phase copes the binary on a clean linux base image, thus discarding all intermediate files…

https://github.com/denisa/clq/blob/main/build/docker/alpine/Dockerfile is an example for a simple golang app

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

No branches or pull requests

3 participants