dcaputo-harmoni / open-balena-admin

Open Balena Admin
MIT License
90 stars 18 forks source link

How to build the containers on arm32v7 or arm64? #8

Open bernhardkaindl opened 2 years ago

bernhardkaindl commented 2 years ago

When I try to compose the containers on an armhf machine, I get these errors (as they are amd64 builds):

postgrest_1  | exec /bin/bash: exec format error
ui_1         | exec /bin/bash: exec format error
remote_1     | exec /bin/bash: exec format error

Can I build armhf or arm64 images of containers on armhf or arm64?

It looks like this would be a start:

for container in postgrest ui remote; do
  c=open-balena-$container
  git clone git@github.com/dcaputo-harmoni/$c.git
  docker build -t $c $c/
done

Then collect the new image ids and use them of the docker-compose suing sed 's|dcaputo-harmoni/||' compolse/services.yml

dcaputo-harmoni commented 2 years ago

@bernhardkaindl thank you for the PR’s! With your commit to the open-balena-postgrest I am assuming the containers will now build on arm32v7/arm64? If so I would be happy to post arm builds as well. We should probably have an option in the quickstart script to specify the target architecture as well? Curious how the base open-balena packages handle different architectures as we could always mirror that, I’ve always run them on amd64.