Dockerfile 553 B

12345678910111213141516171819202122
  1. #first stage - builder
  2. FROM gravitl/go-builder as builder
  3. ARG version
  4. ARG tags
  5. WORKDIR /app
  6. COPY . .
  7. ENV GO111MODULE=auto
  8. RUN apk add git
  9. RUN GOOS=linux CGO_ENABLED=1 go build -ldflags="-s -X 'main.version=${version}'" -tags ${tags} .
  10. # RUN go build -tags=ee . -o netmaker main.go
  11. FROM alpine:3.16.2
  12. # add a c lib
  13. RUN apk add gcompat iptables wireguard-tools
  14. # set the working directory
  15. WORKDIR /root/
  16. RUN mkdir -p /etc/netclient/config
  17. COPY --from=builder /app/netmaker .
  18. COPY --from=builder /app/config config
  19. EXPOSE 8081
  20. ENTRYPOINT ["./netmaker"]