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

Improve Docker support for ARM #1050

Closed
mockdeep opened this issue Jul 5, 2023 · 10 comments
Closed

Improve Docker support for ARM #1050

mockdeep opened this issue Jul 5, 2023 · 10 comments

Comments

@mockdeep
Copy link
Collaborator

mockdeep commented Jul 5, 2023

Currently our Docker image is built for amd64. We should figure out a way to also support ARM, since it is not uncommon for users to want to run Stringer on a Raspberry Pi or the like. Having very little experience with Docker, I'm not sure how to proceed with this, but it might require creating a second image that people can pull for ARM devices.

@mockdeep
Copy link
Collaborator Author

mockdeep commented Jul 5, 2023

@guidopetri pinging you on this one. Even if you don't have time to make a PR, it would be super helpful if you could outline the steps I could take to point me in the right direction.

@guidopetri
Copy link
Collaborator

For sure. Apart from the issue mentioned in this comment where we hardcode amd64, there don't seem to be any issues with building an image for ARM (and I'm guessing there won't be for ARM64 either, and I'll verify that as soon as my newest raspberry pi arrives :) ). So I think the steps are:

  • implement automated image building e.g. via CI
  • un-hardcode the amd64, using an ARG directive in docker instead that is essentially a CLI arg passed in at build time
  • extend the automated image building to ARM/ARM64 by targeting that platform during build with --platform + using the ARG

@mockdeep
Copy link
Collaborator Author

mockdeep commented Jul 6, 2023

@guidopetri thank you! We're running on CircleCI, so we should be able to take advantage of ARM support there.

@guidopetri
Copy link
Collaborator

I started a PR here to track this work

@guidopetri
Copy link
Collaborator

With the second bullet point done, I'll see about setting up the docker image build via CircleCI next. I'm not super familiar with it so it may take me a moment.

@mockdeep
Copy link
Collaborator Author

mockdeep commented Jul 9, 2023

Thanks @guidopetri! I'm pretty familiar with CircleCI, so let me know if you get stuck on anything there. I suspect I'll have to configure it with a couple of env variables to publish to docker.

@mockdeep
Copy link
Collaborator Author

mockdeep commented Jul 9, 2023

Also, in case you haven't come across it already, CircleCI provides an orb for Docker stuff.

@guidopetri
Copy link
Collaborator

With #1080 , we now have the first bullet point done as well, and part of the third one. I'll investigate the image that was generated for arm64, but it looks like Github Actions simply allows us to build both platforms.

However, even if the image looks fine, we still need to update the CI to pass the platform build arg into the build; the arm64 image used superchronic's amd64 executable. I'll try and create the followup PR this next week.

@guidopetri
Copy link
Collaborator

#1092 should close this issue :)

@mockdeep
Copy link
Collaborator Author

Thanks for all your work on this @guidopetri!

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

2 participants