OpenSign icon indicating copy to clipboard operation
OpenSign copied to clipboard

Build ARM Images

Open ehowe opened this issue 1 month ago • 1 comments

Build ARM64 Images.

I've been building ARM64 images using a Gitea action workflow, and the containers work flawlessly. No changes to the project or its dependencies were necessary for this, except changing the Docker image source to the official ARM build of the Node container. I took a stab at updating the GitHub action to accomplish this, but my approach might not be the best. I'm happy to update this to follow your best practices if you don't like my approach.

This would also close #1786.

For transparency, here is the Gitea workflow I've been using:

name: Docker Build and Publish
run-name: ${{ gitea.actor }} is runs ci pipeline
on:
  push:
    branches: [arm]

jobs:
  publish:
    strategy:
      matrix:
        include:
          - image: <private registry>/opensign
            dockerfile: apps/OpenSign/Dockerhubfile
          - image: <private registry>/opensignserver
            dockerfile: apps/OpenSignServer/Dockerhubfile
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/catthehacker/ubuntu:act-latest
    steps:
      - uses: https://github.com/actions/checkout@v4
      - name: Set up Docker Buildx
        uses: https://github.com/docker/setup-buildx-action@v3
        env:
          DOCKER_HOST: unix:///var/run/docker.sock
        with:
          config-inline: |
            [registry."<private registry>"]
      - name: Log in to Docker Registry
        uses: https://github.com/docker/login-action@v3
        with:
          registry: <private registry>
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}
      - name: Build and push Docker image
        uses: https://github.com/docker/build-push-action@v5
        env:
          DOCKER_HOST: unix:///var/run/docker.sock
        with:
          context: .
          file: ${{ matrix.dockerfile }}
          push: true
          platforms: linux/arm64
          tags: |
            ${{ matrix.image }}:${{ gitea.sha }}
            ${{ matrix.image }}:latest

ehowe avatar Oct 29 '25 11:10 ehowe

@ehowe is attempting to deploy a commit to the prafull 's projects Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Oct 29 '25 11:10 vercel[bot]

i think you don't need to do this much changes @ehowe. below code is enough

name: ci

# 👇 add this block
permissions:
  contents: read        # allow checkout & metadata-action to read repo
  id-token: write       # needed by docker/metadata-action v4

on:
  push:
    branches:
      - 'main'
      - 'staging'

jobs:
  docker:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - image: opensign/opensign
            dockerfile: apps/OpenSign/Dockerhubfile
          - image: opensign/opensignserver
            dockerfile: apps/OpenSignServer/Dockerhubfile

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      # 👇 Enable emulation so we can build for arm64 on amd64 runners
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v2
        with:
          platforms: linux/amd64,linux/arm64

      # 👇 Enable Buildx for multi-arch builds
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2

      - name: Login to Docker Hub
        uses: docker/login-action@v2
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - name: Extract metadata (tags, labels) for Docker
        id: meta
        uses: docker/metadata-action@v4
        with:
          images: ${{ matrix.image }}

      - name: Debug - List files opensign
        run: ls -R apps/OpenSign/  # Adjust the path as needed

      - name: Debug - List files opensignserver
        run: ls -R apps/OpenSignServer/  # Adjust the path as needed  

      - name: Build and push (multi-arch)
        uses: docker/build-push-action@v4
        with:
          context: .
          file: ${{ matrix.dockerfile }}
          push: true
          # 👇 Build for both AMD64 & ARM64
          platforms: linux/amd64,linux/arm64
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}

rjcodedev avatar Nov 19 '25 06:11 rjcodedev

@rjcodedev That makes perfect sense for the mainline project. For what I'm doing, I had to make the changes I did because I am building the ARM image on ARM. I'm happy to update the PR to include the change you suggested instead of my original, if you'd like me to.

ehowe avatar Nov 19 '25 17:11 ehowe

https://github.com/all-contributors add @ehowe for code

nxglabs avatar Nov 20 '25 06:11 nxglabs

@nxglabs

I've put up a pull request to add @ehowe! :tada:

allcontributors[bot] avatar Nov 20 '25 06:11 allcontributors[bot]

@ehowe Thanks for this. We have implemented these changes in the latest version. Appreciate your efforts.

nxglabs avatar Nov 20 '25 06:11 nxglabs