fix(docker): auto-detect target arch for local ARM builds
This commit is contained in:
1 parent
3725694bdf
commit
01924f4a69
4 files changed
+10
-6
No files matched your search
@@ -113,7 +113,7 @@ jobs:
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./docker/Dockerfile
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
|
||||
@@ -114,7 +114,7 @@ jobs:
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./docker/Dockerfile
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
|
||||
+6
-3
@@ -8,12 +8,15 @@ RUN npm run build
|
||||
|
||||
FROM golang:1.24 AS go-builder
|
||||
WORKDIR /app
|
||||
ARG TARGETOS=linux
|
||||
ARG TARGETARCH=amd64
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
COPY go.mod go.sum* ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /out/ds2api ./cmd/ds2api
|
||||
RUN set -eux; \
|
||||
GOOS="${TARGETOS:-$(go env GOOS)}"; \
|
||||
GOARCH="${TARGETARCH:-$(go env GOARCH)}"; \
|
||||
CGO_ENABLED=0 GOOS="${GOOS}" GOARCH="${GOARCH}" go build -o /out/ds2api ./cmd/ds2api
|
||||
|
||||
FROM busybox:1.36.1-musl AS busybox-tools
|
||||
|
||||
|
||||
@@ -338,7 +338,8 @@ function showStatus() {
|
||||
function waitForProcesses() {
|
||||
return new Promise(resolve => {
|
||||
const check = setInterval(() => {
|
||||
if (processes.filter(p => !p.killed).length === 0) {
|
||||
const activeCount = processes.filter(proc => proc.exitCode === null && proc.signalCode === null).length;
|
||||
if (activeCount === 0) {
|
||||
clearInterval(check);
|
||||
resolve();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user