netmaker/docker/Dockerfile-netmaker-slim

27 lines
495 B
Text
Raw Normal View History

2021-09-27 21:57:12 +08:00
#first stage - builder
FROM gravitl/builder as builder
WORKDIR /app
COPY . .
ENV GO111MODULE=auto
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=1 /usr/local/go/bin/go build -ldflags="-w -s" -o netmaker main.go
2022-03-28 21:49:21 +08:00
FROM alpine:3.15.2
# add a c lib
2022-02-26 07:04:42 +08:00
RUN apk add gcompat iptables wireguard-tools
2021-09-27 21:57:12 +08:00
# set the working directory
WORKDIR /root/
RUN mkdir -p /etc/netclient/config
2021-09-27 21:57:12 +08:00
COPY --from=builder /app/netmaker .
COPY --from=builder /app/config config
EXPOSE 8081
EXPOSE 50051
ENTRYPOINT ["./netmaker"]