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
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./docker/Dockerfile
|
file: ./Dockerfile
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ jobs:
|
|||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./docker/Dockerfile
|
file: ./Dockerfile
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
|
|||||||
+6
-3
@@ -8,12 +8,15 @@ RUN npm run build
|
|||||||
|
|
||||||
FROM golang:1.24 AS go-builder
|
FROM golang:1.24 AS go-builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ARG TARGETOS=linux
|
ARG TARGETOS
|
||||||
ARG TARGETARCH=amd64
|
ARG TARGETARCH
|
||||||
COPY go.mod go.sum* ./
|
COPY go.mod go.sum* ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
COPY . .
|
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
|
FROM busybox:1.36.1-musl AS busybox-tools
|
||||||
|
|
||||||
|
|||||||
@@ -338,7 +338,8 @@ function showStatus() {
|
|||||||
function waitForProcesses() {
|
function waitForProcesses() {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
const check = setInterval(() => {
|
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);
|
clearInterval(check);
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user