Files
onix/Dockerfile.adapter-with-plugins

33 lines
798 B
Docker

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}"]