-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile.docs
38 lines (29 loc) · 1.23 KB
/
Dockerfile.docs
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
FROM golang:1.11.4-stretch
ENV GOPROXY=https://proxy.golang.org
WORKDIR /project
VOLUME /project
RUN apt-get update -y && \
apt-get install -y unzip jq && \
rm -rf /var/lib/apt/lists/*
ARG protobuf=3.9.1
ARG gogoprotobuf=1.3.0
ARG version
ENV version=${version}
# install protobuf(protoc).
RUN wget -q https://github.com/protocolbuffers/protobuf/releases/download/v$protobuf/protoc-$protobuf-linux-x86_64.zip -O /tmp/protobuf.zip && \
mkdir /tmp/protobuf && \
unzip /tmp/protobuf.zip -d /tmp/protobuf && \
mv /tmp/protobuf/bin/* /usr/local/bin/ && \
mv /tmp/protobuf/include/* /usr/local/include/ && \
rm -rf /tmp/protobuf
RUN cd /tmp/ && \
git clone https://github.com/krhubert/protobuf.git && \
cd protobuf && \
make install && \
mkdir -p /usr/local/include/gogo/protobuf/ && \
cp gogoproto/gogo.proto /usr/local/include/gogo/protobuf/
# download gogo proto files
RUN mkdir -p /usr/local/include/gogo/protobuf/ && \
wget -qO- https://github.com/gogo/protobuf/archive/v${gogoprotobuf}.tar.gz | tar -xzf - protobuf-${gogoprotobuf}/gogoproto/gogo.proto && \
mv protobuf-${gogoprotobuf}/gogoproto /usr/local/include/gogo/protobuf/
RUN go get -u github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc