| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 | FROM debian:buster as builder# add glib support daemon managerRUN apt update -y && apt install -y wget bash gcc musl-dev openssl golang git build-essential libmnl-dev iptablesRUN wget -O go.tgz https://go.dev/dl/go1.19.linux-amd64.tar.gzRUN tar -C /usr/local -xzf go.tgzWORKDIR /usr/local/go/srcRUN chmod +x make.bashRUN ./make.bashENV PATH="/usr/local/go/bin:$PATH"ENV GOPATH=/opt/go/ENV PATH=$PATH:$GOPATH/binWORKDIR /appCOPY . .ENV GO111MODULE=autoRUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 /usr/local/go/bin/go build -ldflags="-w -s" -o netclient-app netclient/main.goWORKDIR /root/RUN git clone https://git.zx2c4.com/wireguard-go && \    cd wireguard-go && \    make && \    make installENV WITH_WGQUICK=yesRUN git clone https://git.zx2c4.com/wireguard-tools && \    cd wireguard-tools && \    cd src && \    make && \    make installFROM debian:busterWORKDIR /root/RUN apt update -y && apt install -y bash curl wget traceroute procps dnsutils iptables openresolv iproute2COPY --from=builder /usr/bin/wireguard-go /usr/bin/wg* /usr/bin/COPY --from=builder /app/netclient-app ./netclientCOPY --from=builder /app/scripts/netclient.sh .RUN chmod 0755 netclient && chmod 0755 netclient.shENV WG_QUICK_USERSPACE_IMPLEMENTATION=wireguard-goENTRYPOINT ["/bin/bash", "./netclient.sh"]
 |