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

Provide ARM based image on docker hub #58

Open
everflux opened this issue Jul 4, 2020 · 5 comments
Open

Provide ARM based image on docker hub #58

everflux opened this issue Jul 4, 2020 · 5 comments

Comments

@everflux
Copy link

everflux commented Jul 4, 2020

It would be very convenient if you could provide a multi arch image on docker hub, so that ARM is supported as well.

@darklynx
Copy link
Owner

darklynx commented Jul 4, 2020

that make sense 👍
do you have any hints on how to achieve that or any article that descries how to do it right with docker hub?

@everflux
Copy link
Author

everflux commented Jul 7, 2020

You could look into how I did it with a DockerHub based build here: https://github.com/trion-development/docker-ng-cli A (german, but google translate should work) description is here: https://www.trion.de/news/2019/10/14/docker-multi-arch-dockerhub.html

@maaroen
Copy link

maaroen commented May 5, 2023

I'm also interested in this, is there any progress on it?

I could send you a sample command to build for arm64 if needed, I just have a startup issue with it

@maaroen
Copy link

maaroen commented May 15, 2023

This is how I made a working ARM64 image:

  • I changed the GOARCH to arm64 in the multistage dockerfile
  • I changed the images of golang and alpine to: arm64v8/golang and arm64v8/alpine (this shouldn't be needed, see next step)
  • I ran the build using the following command: docker buildx build --tag registry.xxx.nl/request-baskets:latest --tag registry.xxx.nl/request-baskets:1.2.3 --platform linux/arm64 --file docker/multistage/Dockerfile --push . From the root directory of the repository. By specifying the --platform linux/arm64 flag, it should automatically choose the correct arm64 images when pulling the base images to build and publish with.

So basically the only change I would assume to be needed is the GOARCH value in the dockerfile. Is setting this value actually needed, or could this be retrieved from the operating system? If this is the case then you can easily make multiplatform builds using this command:

docker buildx build --tag registry.xxx.nl/request-baskets:latest --tag registry.xxx.nl/request-baskets:1.2.3 --platform linux/arm64 --platform linux/amd64 --progress=plain --file docker/multistage/Dockerfile --push .

@darklynx
Copy link
Owner

I wonder if all that can be automated via GitHub actions and results are hosted on GitHub container registry.

Unfortunately dont have time to look at it, but PR or a link to a simple example are highly appreciated :)

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

3 participants