Skip to content

Commit 571d6fb

Browse files
committed
Refactor Dockerfile to simplify build process by removing cross-compilation arguments and ensuring CGO is enabled for sqlite3 support.
1 parent b0670fe commit 571d6fb

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM --platform=$BUILDPLATFORM golang:1.21-alpine AS builder
2+
FROM golang:1.21-alpine AS builder
33

44
# Install build dependencies
55
RUN apk add --no-cache gcc musl-dev
@@ -13,12 +13,8 @@ RUN go mod download
1313
# Copy source code
1414
COPY . .
1515

16-
# Build arguments for cross-compilation
17-
ARG TARGETOS
18-
ARG TARGETARCH
19-
20-
# Build the application
21-
RUN CGO_ENABLED=1 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-s -w" -o puter2api .
16+
# Build the application (CGO required for sqlite3)
17+
RUN CGO_ENABLED=1 go build -ldflags="-s -w" -o puter2api .
2218

2319
# Runtime stage
2420
FROM alpine:latest

0 commit comments

Comments
 (0)