Skip to content

Commit 4d9959f

Browse files
authored
Merge pull request #1414 from KagurazakaNyaa/master
ci: add linux/arm64 platform support for docker
2 parents b3caf3a + 95973a6 commit 4d9959f

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/docker.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jobs:
1919
name=ghcr.io/${{ github.repository }}-web
2020
name=githubyumao/mcsmanager-web,enable=${{ github.repository == 'MCSManager/MCSManager' }}
2121
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v3
24+
2225
- name: Set up Docker Buildx
2326
uses: docker/setup-buildx-action@v3
2427

@@ -41,8 +44,11 @@ jobs:
4144
with:
4245
file: dockerfile/web.dockerfile
4346
push: true
47+
platforms: linux/amd64,linux/arm64
4448
tags: ${{ steps.meta_web.outputs.tags }}
4549
labels: ${{ steps.meta_web.outputs.labels }}
50+
build-args: |
51+
BUILDPLATFORM=linux/amd64
4652
4753
build-daemon:
4854
runs-on: ubuntu-latest
@@ -63,6 +69,9 @@ jobs:
6369
name=ghcr.io/${{ github.repository }}-daemon-jdk${{ matrix.java_version }}
6470
name=githubyumao/mcsmanager-daemon-jdk${{ matrix.java_version }},enable=${{ github.repository == 'MCSManager/MCSManager' }}
6571
72+
- name: Set up QEMU
73+
uses: docker/setup-qemu-action@v3
74+
6675
- name: Set up Docker Buildx
6776
uses: docker/setup-buildx-action@v3
6877

@@ -85,7 +94,9 @@ jobs:
8594
with:
8695
file: dockerfile/daemon.dockerfile
8796
push: true
97+
platforms: linux/amd64,linux/arm64
8898
tags: ${{ steps.meta_daemon.outputs.tags }}
8999
labels: ${{ steps.meta_daemon.outputs.labels }}
90100
build-args: |
101+
BUILDPLATFORM=linux/amd64
91102
JAVA_RUNTIME=${{ matrix.java_version }}

dockerfile/daemon.dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ARG EMBEDDED_JAVA_VERSION=21
2+
ARG BUILDPLATFORM=linux/amd64
23

3-
FROM node:lts AS builder
4+
FROM --platform=${BUILDPLATFORM} node:lts AS builder
45

56
WORKDIR /src
67
COPY . /src

dockerfile/web.dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM node:lts AS builder
1+
ARG BUILDPLATFORM=linux/amd64
2+
FROM --platform=${BUILDPLATFORM} node:lts AS builder
23

34
WORKDIR /src
45
COPY . /src

0 commit comments

Comments
 (0)