File tree Expand file tree Collapse file tree 11 files changed +102
-96
lines changed Expand file tree Collapse file tree 11 files changed +102
-96
lines changed Original file line number Diff line number Diff line change 1+ config /dnsconfig /
2+ data /
Original file line number Diff line number Diff line change 11# first stage - builder
2-
3- FROM golang:latest as builder
4-
5- COPY . /app
2+ FROM gravitl/builder as builder
63
74WORKDIR /app
85
9- ENV GO111MODULE=auto
10-
11- RUN GOARCH=amd64 CGO_ENABLED=1 GOOS=linux go build -ldflags="-w -s" -o app main.go
12-
13- WORKDIR /app/netclient
6+ COPY . .
147
158ENV GO111MODULE=auto
169
17- RUN GOARCH=amd64 CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o netclient main.go
18-
19- # second stage
20-
21- FROM debian:latest
22-
23- RUN apt-get update && apt-get -y install systemd procps
10+ RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=1 /usr/local/go/bin/go build -ldflags="-w -s" -o netmaker main.go
2411
12+ FROM alpine:3.13.6
13+ # add a c lib
14+ RUN apk add gcompat iptables
15+ # set the working directory
2516WORKDIR /root/
2617
27- COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
18+ RUN mkdir -p /etc/netclient/config
2819
29- COPY --from=builder /app .
20+ COPY --from=builder /app/netmaker .
3021COPY --from=builder /app/config config
31- COPY --from=builder /app/netclient netclient
3222
3323EXPOSE 8081
3424EXPOSE 50051
3525
36- CMD ["./app " ]
26+ ENTRYPOINT ["./netmaker " ]
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ services:
2424 SERVER_GRPC_HOST : " grpc.NETMAKER_BASE_DOMAIN"
2525 API_PORT : " 8081"
2626 GRPC_PORT : " 50051"
27- CLIENT_MODE : " contained "
27+ CLIENT_MODE : " on "
2828 MASTER_KEY : " REPLACE_MASTER_KEY"
2929 SERVER_GRPC_WIREGUARD : " off"
3030 CORS_ALLOWED_ORIGIN : " *"
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ services:
2424 SERVER_GRPC_HOST : " grpc.NETMAKER_BASE_DOMAIN"
2525 API_PORT : " 8081"
2626 GRPC_PORT : " 50051"
27- CLIENT_MODE : " contained "
27+ CLIENT_MODE : " on "
2828 MASTER_KEY : " REPLACE_MASTER_KEY"
2929 SERVER_GRPC_WIREGUARD : " off"
3030 CORS_ALLOWED_ORIGIN : " *"
Original file line number Diff line number Diff line change 1+ #first stage - builder
2+
3+ FROM golang:latest as builder
4+
5+ COPY . /app
6+
7+ WORKDIR /app
8+
9+ ENV GO111MODULE=auto
10+
11+ RUN GOARCH=amd64 CGO_ENABLED=1 GOOS=linux go build -ldflags="-w -s" -o app main.go
12+
13+ WORKDIR /app/netclient
14+
15+ ENV GO111MODULE=auto
16+
17+ RUN GOARCH=amd64 CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o netclient main.go
18+
19+ #second stage
20+
21+ FROM debian:latest
22+
23+ RUN apt-get update && apt-get -y install systemd procps
24+
25+ WORKDIR /root/
26+
27+ COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
28+
29+ COPY --from=builder /app .
30+ COPY --from=builder /app/config config
31+ COPY --from=builder /app/netclient netclient
32+
33+ EXPOSE 8081
34+ EXPOSE 50051
35+
36+ CMD ["./app"]
Original file line number Diff line number Diff line change 1- #first stage - builder
1+ FROM gravitl/builder:latest as builder
2+ # add glib support daemon manager
3+ WORKDIR /app
24
3- FROM golang:latest as builder
4-
5- COPY . /app
6-
7- WORKDIR /app/netclient
5+ COPY . .
86
97ENV GO111MODULE=auto
108
11- RUN CGO_ENABLED=0 GOOS=linux go build -o netclient main.go
12-
13- #second stage
9+ RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 /usr/local/go/bin/go build -ldflags="-w -s" -o netclient-app netclient/main.go
1410
15- FROM debian:latest
16-
17- RUN apt-get update && apt-get -y install systemd procps
11+ FROM alpine:3.13.6
1812
13+ RUN apk add gcompat iptables && mkdir -p /etc/netclient
14+ # set the working directory
1915WORKDIR /root/
2016
21- COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
22-
23- COPY --from=builder /app/netclient/netclient .
17+ COPY --from=builder /app/netclient-app /etc/netclient/netclient
18+ COPY --from=builder /app/scripts/netclient.sh .
2419
25- CMD ["./ netclient"]
20+ RUN chmod 0755 /etc/ netclient/netclient && chmod 0755 netclient.sh
2621
22+ ENTRYPOINT ["./netclient.sh"]
Original file line number Diff line number Diff line change 1+ #first stage - builder
2+
3+ FROM golang:latest as builder
4+
5+ COPY . /app
6+
7+ WORKDIR /app/netclient
8+
9+ ENV GO111MODULE=auto
10+
11+ RUN CGO_ENABLED=0 GOOS=linux go build -o netclient main.go
12+
13+ #second stage
14+
15+ FROM debian:latest
16+
17+ RUN apt-get update && apt-get -y install systemd procps
18+
19+ WORKDIR /root/
20+
21+ COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
22+
23+ COPY --from=builder /app/netclient/netclient .
24+
25+ CMD ["./netclient"]
26+
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -3,9 +3,10 @@ package command
33import (
44 "log"
55 "os"
6+ "strconv"
67 "strings"
78 "time"
8- "strconv"
9+
910 nodepb "github.com/gravitl/netmaker/grpc"
1011 "github.com/gravitl/netmaker/netclient/config"
1112 "github.com/gravitl/netmaker/netclient/daemon"
@@ -67,14 +68,14 @@ func getWindowsInterval() int {
6768 return interval
6869 }
6970 netint , err := strconv .Atoi (cfg .Server .CheckinInterval )
70- if err == nil && netint != 0 {
71+ if err == nil && netint != 0 {
7172 interval = netint
7273 }
7374 return interval
7475}
7576
7677func RunUserspaceDaemon () {
77-
78+
7879 cfg := config.ClientConfig {
7980 Network : "all" ,
8081 }
You can’t perform that action at this time.
0 commit comments