-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathDockerfile.client
More file actions
28 lines (21 loc) · 782 Bytes
/
Dockerfile.client
File metadata and controls
28 lines (21 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM golang:bookworm AS build
# Install protoc and protoc-go packages
RUN apt update && apt install -y protobuf-compiler
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
# Copy files to container
WORKDIR /go/src/client
COPY ./src/client .
# Build proto file
WORKDIR /go/src/client/codenamecreator
RUN protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=./ --go-grpc_opt=paths=source_relative ./*.proto
# Build app
WORKDIR /go/src/client
RUN go get google.golang.org/grpc
RUN go build -o /output/client client.go
FROM golang:bookworm
WORKDIR /app
COPY --from=build /output/client .
COPY --from=build /go/src/client/codenamecreator .
COPY ./src/creds/*.crt ./
ENTRYPOINT ["./client"]