-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (20 loc) · 821 Bytes
/
Copy pathDockerfile
File metadata and controls
30 lines (20 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM --platform=$BUILDPLATFORM golang:latest AS builder
ARG TARGETOS
ARG TARGETARCH
WORKDIR /work
COPY . .
# Build main application (cross-compile on build platform).
# EMBED_CA=1: the final image is FROM scratch with no CA store, so HTTPS
# plugins need the embedded Mozilla roots (inert when a CA volume is mounted).
RUN GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} make EMBED_CA=1
# Build all plugins (cross-compile on build platform)
RUN GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} make plugin
FROM scratch
WORKDIR /app
# Copy main application
COPY --from=builder /work/stunmesh-go /app/stunmesh-go
# Copy all plugins to /app (automatically includes any new plugins)
COPY --from=builder /work/contrib/*/stunmesh-* /app/
# Set PATH to include /app directory
ENV PATH="/app:${PATH}"
CMD ["/app/stunmesh-go"]