fix arch issue
Some checks failed
Deploy Matrix Bot / deploy (push) Waiting to run
Docker Build / build (push) Has been cancelled

This commit is contained in:
shinya 2026-03-04 22:31:20 +01:00
parent 5631178a86
commit f119125620
2 changed files with 5 additions and 3 deletions

View File

@ -13,7 +13,7 @@ jobs:
uses: actions/checkout@v4
- name: Build image
run: docker build -t matrix-bot:latest .
run: docker build -t matrix-bot:latest --build-arg TARGETOS=linux --build-arg TARGETARCH=arm64 .
- name: Stop and remove old container
run: |

View File

@ -1,13 +1,15 @@
FROM golang:1.25.5-alpine AS build
ARG TARGETOS
ARG TARGETARCH
WORKDIR /app
RUN apk add --no-cache ca-certificates olm-dev build-base
COPY go.mod go.sum ./
COPY go.mod ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o matrix-bot ./
RUN CGO_ENABLED=1 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-arm64} go build -o matrix-bot ./
FROM alpine:3.19
WORKDIR /app