updated dockerfile
This commit is contained in:
@@ -15,12 +15,15 @@ ARG GIT_COMMIT=unknown
|
||||
WORKDIR /build
|
||||
|
||||
# Cache dependencies first
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY go.mod ./
|
||||
RUN go mod download || true
|
||||
|
||||
# Copy source
|
||||
COPY . .
|
||||
|
||||
# Generate go.sum and ensure all deps are fetched
|
||||
RUN go mod tidy
|
||||
|
||||
# Build static binary
|
||||
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
|
||||
-ldflags="-s -w \
|
||||
|
||||
Reference in New Issue
Block a user