mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 16:57:51 +08:00
delete wg interfaces on netclient docker shutdown
This commit is contained in:
39
docker/Dockerfile-netclient-multiarch-userspace
Normal file
39
docker/Dockerfile-netclient-multiarch-userspace
Normal file
@@ -0,0 +1,39 @@
|
||||
FROM gravitl/go-builder:latest as builder
|
||||
# add glib support daemon manager
|
||||
WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
ENV GO111MODULE=auto
|
||||
|
||||
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 /usr/local/go/bin/go build -ldflags="-w -s" -o netclient-app netclient/main.go
|
||||
|
||||
WORKDIR /root/
|
||||
|
||||
RUN apk add --update git build-base libmnl-dev iptables
|
||||
|
||||
RUN git clone https://git.zx2c4.com/wireguard-go && \
|
||||
cd wireguard-go && \
|
||||
make && \
|
||||
make install
|
||||
|
||||
ENV WITH_WGQUICK=yes
|
||||
RUN git clone https://git.zx2c4.com/wireguard-tools && \
|
||||
cd wireguard-tools && \
|
||||
cd src && \
|
||||
make && \
|
||||
make install
|
||||
|
||||
FROM alpine:3.13.6
|
||||
|
||||
WORKDIR /root/
|
||||
|
||||
RUN apk add --no-cache --update bash libmnl gcompat iptables openresolv iproute2
|
||||
COPY --from=builder /usr/bin/wireguard-go /usr/bin/wg* /usr/bin/
|
||||
COPY --from=builder /app/netclient-app ./netclient
|
||||
COPY --from=builder /app/scripts/netclient.sh .
|
||||
RUN chmod 0755 netclient && chmod 0755 netclient.sh
|
||||
|
||||
ENV WG_QUICK_USERSPACE_IMPLEMENTATION=wireguard-go
|
||||
|
||||
ENTRYPOINT ["/bin/bash", "./netclient.sh"]
|
Reference in New Issue
Block a user