dockerfiles
dockerfiles copied to clipboard
Add support for ARM architectures
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.).
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?
Don't know if this would help: https://gitlab.b-data.ch/ghc/ghc4pandoc
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.
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.
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
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
I'm doing some tests on https://github.com/cdivita/pandoc-dockerfiles:
- Builds for
linux/arm64
platform usingdocker 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) - When building multi-architecture images with
docker buildx
, theoutput=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)