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
|
|
|
|
|
|
|
|
FROM alpine:3.13.6
|
2021-09-28 05:51:20 +08:00
|
|
|
# add a c lib
|
2021-09-27 21:57:12 +08:00
|
|
|
RUN apk add gcompat iptables
|
|
|
|
# set the working directory
|
|
|
|
WORKDIR /root/
|
|
|
|
|
2021-10-06 03:02:09 +08:00
|
|
|
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"]
|