Issue 533 - Add new Dockerfile to build adapter and plugins together

This commit is contained in:
ameersohel45
2025-10-14 13:10:33 +05:30
parent 869b3985d6
commit 4974c6a465

View File

@@ -0,0 +1,32 @@
FROM golang:1.24-bullseye AS builder
WORKDIR /workspace/app
# Specifically copy only the necessary files and directories
COPY cmd/adapter/ ./cmd/adapter/
COPY core/ ./core/
COPY pkg/ ./pkg/
COPY install/build-plugins.sh ./install/build-plugins.sh
COPY go.mod .
COPY go.sum .
RUN go mod download
# Build main server
RUN go build -o server cmd/adapter/main.go
# Make the build script executable and run it to build plugins
RUN chmod +x install/build-plugins.sh && \
./install/build-plugins.sh
# Create minimal runtime image
FROM cgr.dev/chainguard/wolfi-base
WORKDIR /app
# Copy binary and plugins built with same Go version
COPY --from=builder /workspace/app/server .
COPY --from=builder /workspace/app/plugins ./plugins
EXPOSE 8081
CMD ["sh", "-c", "./server --config=${CONFIG_FILE}"]