netmaker/docker/Dockerfile-netclient-multiarch

23 lines
584 B
Text
Raw Normal View History

2022-02-28 17:25:21 +08:00
FROM golang:latest as builder
# add glib support daemon manager
WORKDIR /app
2022-02-10 20:33:10 +08:00
ARG version
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
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
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"]