OpenSign
OpenSign copied to clipboard
Build ARM Images
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 is attempting to deploy a commit to the prafull 's projects Team on Vercel.
A member of the Team first needs to authorize it.
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 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.
https://github.com/all-contributors add @ehowe for code
@ehowe Thanks for this. We have implemented these changes in the latest version. Appreciate your efforts.