diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index fa012e29..3b47e7db 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -19,6 +19,9 @@ jobs: name=ghcr.io/${{ github.repository }}-web name=githubyumao/mcsmanager-web,enable=${{ github.repository == 'MCSManager/MCSManager' }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -41,8 +44,11 @@ jobs: with: file: dockerfile/web.dockerfile push: true + platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta_web.outputs.tags }} labels: ${{ steps.meta_web.outputs.labels }} + build-args: | + BUILDPLATFORM=linux/amd64 build-daemon: runs-on: ubuntu-latest @@ -63,6 +69,9 @@ jobs: name=ghcr.io/${{ github.repository }}-daemon-jdk${{ matrix.java_version }} name=githubyumao/mcsmanager-daemon-jdk${{ matrix.java_version }},enable=${{ github.repository == 'MCSManager/MCSManager' }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -85,7 +94,9 @@ jobs: with: file: dockerfile/daemon.dockerfile push: true + platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta_daemon.outputs.tags }} labels: ${{ steps.meta_daemon.outputs.labels }} build-args: | + BUILDPLATFORM=linux/amd64 JAVA_RUNTIME=${{ matrix.java_version }} diff --git a/dockerfile/daemon.dockerfile b/dockerfile/daemon.dockerfile index 74d8666b..77ad30de 100644 --- a/dockerfile/daemon.dockerfile +++ b/dockerfile/daemon.dockerfile @@ -1,6 +1,7 @@ ARG EMBEDDED_JAVA_VERSION=21 +ARG BUILDPLATFORM=linux/amd64 -FROM node:lts AS builder +FROM --platform=${BUILDPLATFORM} node:lts AS builder WORKDIR /src COPY . /src diff --git a/dockerfile/web.dockerfile b/dockerfile/web.dockerfile index 5e6820df..04ca058f 100644 --- a/dockerfile/web.dockerfile +++ b/dockerfile/web.dockerfile @@ -1,4 +1,5 @@ -FROM node:lts AS builder +ARG BUILDPLATFORM=linux/amd64 +FROM --platform=${BUILDPLATFORM} node:lts AS builder WORKDIR /src COPY . /src