File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 5
5
FROM golang:1.22-alpine AS base-build
6
6
7
7
WORKDIR /build
8
- RUN go env -w GOMODCACHE=/root/.cache/go-build
9
8
9
+ RUN apk add --no-cache protobuf-dev
10
+
11
+ RUN go env -w GOMODCACHE=/root/.cache/go-build
10
12
COPY ./src/checkoutservice/go.mod ./src/checkoutservice/go.sum ./
11
13
RUN --mount=type=cache,target=/root/.cache/go-build go mod download
12
14
13
15
COPY ./src/checkoutservice/tools.go ./
14
16
RUN --mount=type=cache,target=/root/.cache/go-build \
15
17
go list -e -f '{{range .Imports}}{{.}} {{end}}' tools.go | CGO_ENABLED=0 xargs go install -mod=readonly
16
18
17
- RUN apk add --no-cache protobuf-dev
19
+ COPY ./pb ./pb
20
+ RUN --mount=type=cache,target=/root/.cache/go-build \
21
+ protoc -I ./pb ./pb/demo.proto --go_out=./ --go-grpc_out=./
18
22
19
23
COPY ./src/checkoutservice ./
20
- COPY ./pb ./pb
21
24
RUN --mount=type=cache,target=/root/.cache/go-build \
22
- protoc -I ./pb ./pb/demo.proto --go_out=./ --go-grpc_out=./ \
23
- && go build -ldflags "-s -w" -o /go/bin/checkoutservice/ ./
25
+ go build -ldflags "-s -w" -o /go/bin/checkoutservice/ ./
24
26
25
27
FROM alpine
26
28
You can’t perform that action at this time.
0 commit comments