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

Enable multi-platform Docker builds in GitHub Actions - Update build-… #570

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

migueltsantana
Copy link

This commit updates the GitHub Actions workflow to support building and pushing Docker images for multiple CPU architectures using Docker Buildx.

What’s Changed

  • Added docker/setup-buildx-action to enable Buildx for multi-platform builds.

  • Updated docker/build-push-action to target the following platforms:

    • linux/amd64 (standard x86_64)
    • linux/arm64 (ARM64, e.g., newer Raspberry Pi)
    • linux/arm64/v8 (64-bit ARM v8 architecture)
    • linux/arm/v7 (32-bit ARM, e.g., Raspberry Pi 3 and earlier)
  • Ensured the workflow pushes multi-platform images to Docker Hub.

Why This Change?

The current Docker image is only built for a single CPU architecture, which limits its usability on ARM-based devices like Raspberry Pi. By enabling multi-platform builds, Papermerge becomes more accessible and deployable across a wider range of hardware platforms, including ARM64 and ARMv8 systems, without requiring emulation.

How to Verify

  • The workflow builds and pushes the Docker image for the following platforms:
    • linux/amd64
    • linux/arm64
    • linux/arm64/v8
    • linux/arm/v7
  • Users on ARM and x86 systems can now pull and run the image natively.

…standard-image.yml

This commit updates the GitHub Actions workflow to support building and pushing Docker images for multiple CPU architectures using Docker Buildx.

# What’s Changed
- Added docker/setup-buildx-action to enable Buildx for multi-platform builds.
- Updated docker/build-push-action to target the following platforms:
     - linux/amd64 (standard x86_64)
     - linux/arm64 (ARM64, e.g., newer Raspberry Pi)
     - linux/arm64/v8 (64-bit ARM v8 architecture)
     - linux/arm/v7 (32-bit ARM, e.g., Raspberry Pi 3 and earlier)
- Ensured the workflow pushes multi-platform images to Docker Hub.

# Why This Change?
The current Docker image is only built for a single CPU architecture, which limits its usability on ARM-based devices like Raspberry Pi. By enabling multi-platform builds, Papermerge becomes more accessible and deployable across a wider range of hardware platforms, including ARM64 and ARMv8 systems, without requiring emulation.

# How to Verify
- The workflow builds and pushes the Docker image for the following platforms:
     - linux/amd64
     - linux/arm64
     - linux/arm64/v8
     - linux/arm/v7
- Users on ARM and x86 systems can now pull and run the image natively.
@ciur
Copy link
Member

ciur commented Dec 18, 2024

@migueltsantana

Did you tried to build docker image with your changes ?
Image build is triggered when you push git tag (on your branch):

git tag 3.3b25
git push origin 3.3b25

Long story short, with your changes docker build image fails:
https://github.com/papermerge/papermerge-core/actions/runs/12400297372/job/34617134155?pr=570

Error is:

ERROR: failed to solve: python:3.13-alpine: failed to resolve source metadata for docker.io/library/python:3.13-alpine: no match for platform in manifest: not found
Error: buildx failed with: ERROR: failed to solve: python:3.13-alpine: failed to resolve source metadata for docker.io/library/python:3.13-alpine: no match for platform in manifest: not found

Copy link
Author

@migueltsantana migueltsantana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the file and removed "arm/v5" that was causing conflicts when sourcing Node and Python base images.

@migueltsantana
Copy link
Author

@ciur I did build on my end, but just copy and pasted the PR into the browser instead of doing the PR inside the terminal.

However, from the full logs I saw that the "arm/v5" was a typo and should not be there. Fixed that.

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.

2 participants