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

Support for building ARM docker images #679

Merged
merged 5 commits into from Mar 13, 2023
Merged

Support for building ARM docker images #679

merged 5 commits into from Mar 13, 2023

Conversation

ghost
Copy link

@ghost ghost commented Mar 10, 2023

Currently Docker images are x86_64/amd64 only. This PR enables ARMv8 images to easily be built. Currently only tested building ARM images on Apple Silicon, but I tested the generated images on both a Raspberry Pi 4 and M1 Pro, in other words you can now run SimpleXMQ using docker on Raspberry Pi and Apple Silicon machines (and others?).

I also confirmed that this doesn't break existing x86_64 builds - although I only tested on 64-bit Ubuntu 22.04.2

A test artifact can be found on Docker's registry docker pull shyfire131/smp-server-arm

The commits have been split up and should be self explanatory.

Should fix #678

Hopefully this will also enable you guys to publish arm images to Docker Hub?

+shyfire131 added 4 commits March 9, 2023 20:25
running docker build on Apple Sillicon would result in this error:

#14 49.39 <no location info>: error:
#14 49.39     Warning: Couldn't figure out LLVM version!
#14 49.39              Make sure you have installed LLVM between [9 and 13)

I assume it can’t find llvm/clang?
the current haskell is hardcoded to x86, so switch to using haskell’s official helper script which supports arm

also need to bump up setting the path, since ghcup is no longer in /usr/bin

reference: https://www.haskell.org/ghcup/guide/#continuous-integration
docker build (specifically haskell install step) would fail with :

#7 107.2 utils/ghc-cabal/dist-install/build/tmp/ghc-cabal: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory

I think this is because numa isn’t installed on arm instances of focal by default, but it is in later versions

anyway this fixes that
The image builds at this point! But it fails to boot on arm - again with a numa error.

This fixes that.
@ghost ghost requested a review from epoberezkin as a code owner March 10, 2023 05:06
@shumvgolove
Copy link
Collaborator

Other than small nitpick, LGTM. Thanks for your contribution!

build.Dockerfile Outdated Show resolved Hide resolved
@epoberezkin epoberezkin changed the base branch from stable to master March 13, 2023 20:00
@epoberezkin epoberezkin merged commit 64f5d63 into simplex-chat:master Mar 13, 2023
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 this pull request may close these issues.

Unable to build docker images on Apple Silicon [to build ARM image for start9 marketplace]
2 participants