Skip to content

Commit d5f162f

Browse files
committed
fix arch
1 parent 667cc2d commit d5f162f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ FROM golang:1.25.3-alpine AS builder
44
# Set the working directory inside the container
55
WORKDIR /app
66

7+
# Install build dependencies
8+
RUN apk add --no-cache gcc musl-dev
9+
710
# Copy go mod and sum files
811
COPY go.mod go.sum ./
912

@@ -13,8 +16,10 @@ RUN go mod download
1316
# Copy the source code into the container
1417
COPY . .
1518

16-
# Build the Go app
17-
RUN go build -o curl-live .
19+
# Build the Go app with optimized settings for cross-platform builds
20+
ARG TARGETOS
21+
ARG TARGETARCH
22+
RUN CGO_ENABLED=1 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -a -installsuffix cgo -o curl-live .
1823

1924
# Use a minimal alpine image for the final stage
2025
FROM alpine:latest

0 commit comments

Comments
 (0)