dockerfiles icon indicating copy to clipboard operation
dockerfiles copied to clipboard

Add support for ARM architectures

Open logoff opened this issue 3 years ago • 10 comments

Many users want to use pandoc in their ARM based machines. The most popular is Raspberry Pi, but there are many others.

It would be very useful for us to have support for ARM architectures (armv8, armv7l/armv7hl, etc.).

logoff avatar Jan 31 '21 12:01 logoff

Help would be very welcome with this. E.g., can someone point to other Docker images which handle this well? Where do they build the images? Do they use emulators or dedicated machines?

tarleb avatar Jan 05 '22 16:01 tarleb

Don't know if this would help: https://gitlab.b-data.ch/ghc/ghc4pandoc

jgm avatar Jan 05 '22 16:01 jgm

The base images in this project (Alpine, Ubuntu) are afaik already multi-arch. So theoretically you would only need to grab the base image and compile Pandoc in it once on an Intel-based machine (for an Intel-based image) and then again on an ARM machine (Raspberry Pi, Mac M1) for an ARM image.

In https://github.com/cagix/pandoc-hugo-m1 I pulled the ARM binary (Linux) of Pandoc into an Ubuntu base image running on an Apple M1.

cagix avatar Jan 05 '22 16:01 cagix

I've filed a request to be accepted into Docker's open source program. That would give us access to automatic builds, which appear to work with a wide range of architectures.

tarleb avatar Jan 06 '22 08:01 tarleb

After some more research, it seems that all automatic builds on Docker Hub happen with amd64. But it seems that docker buildx may be all we need. Here's an article: https://medium.com/@artur.klauser/building-multi-architecture-docker-images-with-buildx-27d80f7e2408

tarleb avatar Jan 06 '22 16:01 tarleb

You can use this action [1] to setup QEMU in your repo with multi arch support out of the box.

[1] https://github.com/docker/setup-qemu-action [2] https://dev.to/cloudx/multi-arch-docker-images-the-easy-way-with-github-actions-4k54

haad avatar Jun 27 '22 21:06 haad

I'm doing some tests on https://github.com/cdivita/pandoc-dockerfiles:

  1. Builds for linux/arm64 platform using docker buildx require a lot of resources and are really really slow. I launched a build that lasted for 6 hours and failed (I think due to GitHub timeout)
  2. When building multi-architecture images with docker buildx, the output=type=docker cannot be used and images need to be pushed. It means that tests cannot be run after the image build but during the build. My idea is to move the tests within a build stage (that comes from the image to test)

cdivita avatar Nov 25 '22 17:11 cdivita