-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
64 lines (46 loc) · 1.58 KB
/
Dockerfile
File metadata and controls
64 lines (46 loc) · 1.58 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# caddy build stage
FROM caddy:2.10.0-builder AS caddy-builder
# build a custom caddy image with the l4 plugin
RUN xcaddy build \
--with github.com/mholt/caddy-l4@87e3e5e2c7f986b34c0df373a5799670d7b8ca03
# CoreDNS build stage
FROM golang:1.24-alpine AS coredns-builder
WORKDIR /app
# Install build dependencies
RUN apk add --no-cache git make
# Clone and build CoreDNS with fanout plugin
RUN git clone https://github.com/coredns/coredns.git && \
cd coredns && \
git checkout v1.12.1 && \
echo "fanout:github.com/networkservicemesh/fanout" >> plugin.cfg && \
make
# wireport build stage
FROM golang:1.24-alpine AS go-builder
WORKDIR /app
# Install build dependencies for SQLite
RUN apk add --no-cache gcc musl-dev
# Enable CGO for SQLite support
ENV CGO_ENABLED=1
ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
COPY ./app/ .
RUN go build -o wireport ./cmd/server/main.go
# wireguard, tcpdump & other tools
FROM alpine:3.21
# Update base image with security patches and install only the minimal runtime
RUN apk --no-cache upgrade && apk add --no-cache \
wireguard-tools \
iptables \
nano \
bind-tools \
tcpdump \
runit \
docker-cli
COPY --from=caddy-builder /usr/bin/caddy /usr/bin/caddy
COPY --from=coredns-builder /app/coredns/coredns /usr/bin/coredns
COPY --from=go-builder /app/wireport /usr/bin/wireport
VOLUME /app/wireport
COPY ./docker/fs/etc/service /etc/service
RUN mkdir -p /app/wireport/caddy/fs/data /app/wireport/caddy/fs/config /etc/coredns /etc/caddy /etc/service-disabled
COPY ./docker/fs/entry.sh /
RUN chmod +x /entry.sh
ENTRYPOINT ["/entry.sh"]