mirror of
https://github.com/gravitl/netmaker.git
synced 2024-09-23 00:36:40 +08:00
e97566f069
docker files need to be updated as go-builder is built on golang:1.19-alpine3.16 so base image for netmaker/netclient needs to be updated to apline3.16 as well
23 lines
547 B
Docker
23 lines
547 B
Docker
#first stage - builder
|
|
FROM gravitl/go-builder as builder
|
|
ARG version
|
|
ARG tags
|
|
WORKDIR /app
|
|
COPY . .
|
|
ENV GO111MODULE=auto
|
|
|
|
RUN apk add git
|
|
RUN GOOS=linux CGO_ENABLED=1 go build ${tags} -ldflags="-s -X 'main.version=${version}'" .
|
|
# RUN go build -tags=ee . -o netmaker main.go
|
|
FROM alpine:3.16.2
|
|
|
|
# add a c lib
|
|
RUN apk add gcompat iptables wireguard-tools
|
|
# set the working directory
|
|
WORKDIR /root/
|
|
RUN mkdir -p /etc/netclient/config
|
|
COPY --from=builder /app/netmaker .
|
|
COPY --from=builder /app/config config
|
|
EXPOSE 8081
|
|
ENTRYPOINT ["./netmaker"]
|