Issue 533 - Add new Dockerfile to build adapter and plugins together
This commit is contained in:
32
Dockerfile.adapter-with-plugins
Normal file
32
Dockerfile.adapter-with-plugins
Normal 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}"]
|
||||
Reference in New Issue
Block a user