From 4974c6a46525a4d5c327952a8170f919589370e0 Mon Sep 17 00:00:00 2001 From: ameersohel45 Date: Tue, 14 Oct 2025 13:10:33 +0530 Subject: [PATCH] Issue 533 - Add new Dockerfile to build adapter and plugins together --- Dockerfile.adapter-with-plugins | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Dockerfile.adapter-with-plugins diff --git a/Dockerfile.adapter-with-plugins b/Dockerfile.adapter-with-plugins new file mode 100644 index 0000000..926e112 --- /dev/null +++ b/Dockerfile.adapter-with-plugins @@ -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}"]