-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding utilities to run buf in Docker.
- Loading branch information
Showing
2 changed files
with
29 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
# Setup Go alpine to install buf protoc-gen-go plugin. | ||
# At the time of this changes, the buf image doesn't have a way to customise the plugins, so this is a more concise | ||
# solution. | ||
FROM golang:alpine AS golang | ||
ENV GO111MODULE=on | ||
|
||
RUN go install github.com/bufbuild/buf/cmd/[email protected] | ||
RUN go install google.golang.org/protobuf/cmd/[email protected] | ||
|
||
FROM bufbuild/buf:1.45.0 AS buf | ||
|
||
# Wrap everything together in a scratch container to do all things buf. | ||
FROM scratch | ||
COPY --from=golang /go/bin/buf /go/bin/buf | ||
COPY --from=golang /go/bin/protoc-gen-go /go/bin/protoc-gen-go | ||
COPY --from=buf /usr/local/bin/buf /usr/local/bin/buf | ||
ENV PATH="/go/bin:${PATH}" | ||
ENTRYPOINT ["/usr/local/bin/buf"] | ||
ENTRYPOINT ["/go/bin/buf"] |