2022-04-22 18:51:09 +08:00
|
|
|
FROM gravitl/go-builder as builder
|
2022-01-24 00:31:17 +08:00
|
|
|
# add glib support daemon manager
|
|
|
|
WORKDIR /app
|
2022-02-10 20:33:10 +08:00
|
|
|
ARG version
|
2022-01-24 00:31:17 +08:00
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
ENV GO111MODULE=auto
|
|
|
|
|
2022-03-30 05:59:48 +08:00
|
|
|
RUN GOOS=linux CGO_ENABLED=0 /usr/local/go/bin/go build -ldflags="-X 'main.version=${version}'" -o netclient-app netclient/main.go
|
2022-01-24 00:31:17 +08:00
|
|
|
|
2022-03-28 21:49:21 +08:00
|
|
|
FROM alpine:3.15.2
|
2022-01-24 00:31:17 +08:00
|
|
|
|
|
|
|
WORKDIR /root/
|
|
|
|
|
2022-02-28 17:25:21 +08:00
|
|
|
RUN apk add --no-cache --update bash libmnl gcompat iptables openresolv iproute2 wireguard-tools
|
2022-01-24 00:31:17 +08:00
|
|
|
COPY --from=builder /app/netclient-app ./netclient
|
|
|
|
COPY --from=builder /app/scripts/netclient.sh .
|
|
|
|
RUN chmod 0755 netclient && chmod 0755 netclient.sh
|
|
|
|
|
|
|
|
|
2022-05-26 21:58:35 +08:00
|
|
|
ENTRYPOINT ["/bin/bash", "./netclient.sh"]
|