11
Dockerfile
11
Dockerfile
@@ -3,19 +3,20 @@
|
||||
# -----------------------------------------------------
|
||||
FROM golang:1.22-alpine AS plugin_builder
|
||||
|
||||
# Install dependencies needed for CGO plugin build
|
||||
RUN apk add --no-cache git build-base binutils musl-dev
|
||||
# Install full toolchain for CGO + plugins
|
||||
RUN apk add --no-cache \
|
||||
git \
|
||||
build-base \
|
||||
binutils \
|
||||
musl-dev
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
# Download module deps first (better caching)
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Build plugin
|
||||
RUN mkdir -p build && \
|
||||
CGO_ENABLED=1 go build \
|
||||
--trimpath \
|
||||
|
||||
Reference in New Issue
Block a user