-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
40 lines (31 loc) · 893 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
30
31
32
33
34
35
36
37
38
39
40
FROM buildpack-deps:bullseye-scm
COPY --from=golang:1.18-bullseye /usr/local/go/ /usr/local/go/
ENV PATH=/usr/local/go/bin:${PATH}
ENV GOPATH=/go
ENV PATH=/go/bin:$PATH
# https://buf.build/docs/bsr/authentication
ARG BUF_TOKEN
ENV BUF_TOKEN=${BUF_TOKEN}
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin
RUN apt-get update && \
apt-get install -y --no-install-recommends \
protobuf-compiler-grpc \
make \
golang-goprotobuf-dev
ARG BIN=/usr/local/bin
ARG VERSION=1.8.0
RUN curl -sSL \
https://github.com/bufbuild/buf/releases/download/v${VERSION}/buf-$(uname -s)-$(uname -m) \
-o ${BIN}/buf && \
chmod +x ${BIN}/buf
WORKDIR /app
COPY ["go.mod", "go.sum", "buf.gen.*", "/app/"]
RUN go get all \
&& go install \
github.com/golang/mock/mockgen \
github.com/envoyproxy/protoc-gen-validate
COPY Makefile /app/
COPY deps deps
COPY scripts scripts
COPY proto proto
RUN make all