netmaker/docker/Dockerfile-netmaker-slim

27 lines
479 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
FROM alpine:3.13.6
# add a c lib
2021-09-27 21:57:12 +08:00
RUN apk add gcompat iptables
# 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"]