added client Makefile

This commit is contained in:
Pin
2022-05-30 14:10:37 -04:00
parent d904521ff7
commit 7c52844c16
5 changed files with 15 additions and 2 deletions

2
client/golang/Makefile Normal file
View File

@@ -0,0 +1,2 @@
build:
go build -ldflags="-s -w" -o saprus client.go

View File

@@ -102,8 +102,8 @@ func main() {
// Listen timeout // Listen timeout
select { select {
case returnMSG := <- addrChan: case returnMSG := <- addrChan:
fmt.Printf("Discovery Server: %s\n", strings.Fields(returnMSG)[1]) fmt.Printf("%s\n", strings.Fields(returnMSG)[1])
case <- time.After(5 * time.Second): case <- time.After(5 * time.Second):
fmt.Printf("Discovery Server not found\n") fmt.Printf("error\n")
} }
} }

9
server/Dockerfile Normal file
View File

@@ -0,0 +1,9 @@
FROM golang:1.18.2-alpine
RUN mkdir -p /src
COPY server.go /src
WORKDIR /src
RUN go build server.go

2
server/Makefile Normal file
View File

@@ -0,0 +1,2 @@
docker_build:
docker build . -t saprus_server:latest