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

[devops] Cross-compile to, and add aarch64 support in Docker images #63

Open
linuxct opened this issue Jan 15, 2024 · 1 comment
Open

Comments

@linuxct
Copy link
Contributor

linuxct commented Jan 15, 2024

In order to run the application in ARM 64-bit hardware, such as Raspberry Pi's or Mac M-series processors, it needs to be cross-compiled using GOARCH=arm64.

To do this, a go build needs to be ran for both x86_64 (default/current arch) and arm64.
Both binaries need to be kept with separate names, thus the x86_64 can remain as /app/instafix, and the arm binary as /app/instafix-arm.
Then, instead of running the application directly as an entrypoint, it will need to be ran from an entrypoint script that chooses between both available binaries depending on the running device's architecture.
Bonus points if the entrypoint shell script also includes a health check reporting back to the Docker engine.

@linuxct
Copy link
Contributor Author

linuxct commented Jan 15, 2024

I will be submitting a PR for this later on, as so far I have kept a separate fork that allows me to run ARM-only Docker images of instafix, and I would like to get rid of that since it's troublesome to keep up to date with (your) upstream.

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

1 participant