2021-03-26 00:17:52 +08:00
|
|
|
#first stage - builder
|
2022-04-22 18:51:09 +08:00
|
|
|
FROM gravitl/go-builder as builder
|
2022-09-15 02:33:08 +08:00
|
|
|
ARG tags
|
2021-03-26 00:17:52 +08:00
|
|
|
WORKDIR /app
|
2021-10-07 22:57:06 +08:00
|
|
|
COPY . .
|
2021-12-12 01:13:41 +08:00
|
|
|
|
2023-03-01 23:36:57 +08:00
|
|
|
RUN GOOS=linux CGO_ENABLED=1 go build -ldflags="-s -w " -tags ${tags} .
|
2022-09-15 02:33:08 +08:00
|
|
|
# RUN go build -tags=ee . -o netmaker main.go
|
2023-06-21 22:11:02 +08:00
|
|
|
FROM alpine:3.18.2
|
2021-12-12 01:14:55 +08:00
|
|
|
|
2023-03-01 23:36:57 +08:00
|
|
|
# add a c lib
|
2021-10-07 22:57:06 +08:00
|
|
|
# set the working directory
|
2021-05-05 05:36:55 +08:00
|
|
|
WORKDIR /root/
|
2021-10-07 22:57:06 +08:00
|
|
|
RUN mkdir -p /etc/netclient/config
|
|
|
|
COPY --from=builder /app/netmaker .
|
2021-03-26 00:17:52 +08:00
|
|
|
COPY --from=builder /app/config config
|
|
|
|
EXPOSE 8081
|
2021-10-07 22:57:06 +08:00
|
|
|
ENTRYPOINT ["./netmaker"]
|