forked from gravitl/netclient
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (18 loc) · 734 Bytes
/
Dockerfile
File metadata and controls
24 lines (18 loc) · 734 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
FROM gravitl/go-builder AS builder
# add glib support daemon manager
WORKDIR /app
COPY . .
RUN go mod tidy
RUN GOOS=linux CGO_ENABLED=0 /usr/local/go/bin/go build -ldflags="-s -w" -o netclient-app .
FROM alpine:3.20.0
WORKDIR /root/
RUN apk add --no-cache --update bash libmnl gcompat openresolv iproute2 wireguard-tools openrc \
&& mkdir -p /run/openrc \
&& touch /run/openrc/softlevel
RUN apk add iptables ip6tables \
&& mv -v /sbin/ip6tables /sbin/ip6tables-disabled \
&& cp -v /sbin/ip6tables-nft /sbin/ip6tables
COPY --from=builder /app/netclient-app ./netclient
COPY --from=builder /app/scripts/netclient.sh .
RUN chmod 0755 netclient && chmod 0755 netclient.sh
ENTRYPOINT ["/bin/bash", "./netclient.sh"]