Skip to content

Commit 6459f86

Browse files
committed
Adding go generate
1 parent 8d16626 commit 6459f86

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

src/productcatalogservice/Dockerfile

+1-13
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,7 @@ WORKDIR /usr/src/app/
88
RUN apk update \
99
&& apk add --no-cache make protobuf-dev
1010

11-
RUN --mount=type=cache,target=/go/pkg/mod/ \
12-
--mount=type=bind,source=./src/productcatalogservice/go.sum,target=go.sum \
13-
--mount=type=bind,source=./src/productcatalogservice/go.mod,target=go.mod \
14-
--mount=type=bind,source=./src/productcatalogservice/tools.go,target=tools.go \
15-
go mod download \
16-
&& go list -e -f '{{range .Imports}}{{.}} {{end}}' tools.go | CGO_ENABLED=0 xargs go install -mod=readonly
17-
18-
RUN --mount=type=cache,target=/go/pkg/mod/ \
19-
--mount=type=cache,target=/root/.cache/go-build \
20-
--mount=type=bind,rw,source=./src/productcatalogservice,target=. \
21-
--mount=type=bind,rw,source=./pb,target=./pb \
22-
protoc -I ./pb ./pb/demo.proto --go_out=./ --go-grpc_out=./ \
23-
&& go build -ldflags "-s -w" -o /go/bin/productcatalogservice/ ./
11+
RUN go generate
2412

2513
FROM registry.ddbuild.io/images/mirror/alpine:latest AS release
2614

0 commit comments

Comments
 (0)