2022-02-28 17:25:21 +08:00
|
|
|
FROM golang:latest 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-02-10 20:33:10 +08:00
|
|
|
RUN GOOS=linux CGO_ENABLED=0 /usr/local/go/bin/go build -ldflags="-w -s -X 'main.version=${TAG}'" -o netclient-app netclient/main.go
|
2022-01-24 00:31:17 +08:00
|
|
|
|
|
|
|
FROM alpine:3.13.6
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
ENTRYPOINT ["/bin/sh", "./netclient.sh"]
|