netmaker/docker/Dockerfile-netclient-multiarch

23 lines
589 B
Text
Raw Normal View History

2022-04-22 18:51:09 +08:00
FROM gravitl/go-builder as builder
# add glib support daemon manager
WORKDIR /app
2022-02-10 20:33:10 +08:00
ARG version
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-03-28 21:49:21 +08:00
FROM alpine:3.15.2
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/bash", "./netclient.sh"]