-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
29 lines (19 loc) · 819 Bytes
/
Dockerfile
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
29
FROM golang:1.15.6-alpine AS build
WORKDIR /go/src/github.com/dane/proto
COPY files/tools.go .
RUN go mod init && go mod tidy
RUN go install \
google.golang.org/protobuf/cmd/protoc-gen-go \
google.golang.org/grpc/cmd/protoc-gen-go-grpc
FROM bufbuild/buf:0.33.0
LABEL org.opencontainers.image.source="https://github.com/dane/protos"
LABEL org.opencontainers.image.authors="Dane Harrigan"
LABEL org.opencontainers.image,licenses="Mozilla 2.0"
WORKDIR /opt/protos
ENV PATH=$PATH:/opt/protos/bin
ENTRYPOINT ["/opt/protos/bin/entrypoint"]
COPY files/buf.yaml /opt/protos/
COPY files/buf.gen.yaml /opt/protos/
COPY files/entrypoint /opt/protos/bin/entrypoint
COPY --from=build /go/bin/protoc-gen-go /usr/local/bin/protoc-gen-go
COPY --from=build /go/bin/protoc-gen-go-grpc /usr/local/bin/protoc-gen-go-grpc