forked from libopenstorage/openstorage-sdk-clients
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.proto
72 lines (65 loc) · 2.4 KB
/
Dockerfile.proto
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#
# Do not use directly, use `make docker-proto` instead
#
FROM fedora
MAINTAINER luis@portworx.com
ENV GOPATH=/go
RUN dnf -y update && \
dnf -y install \
findutils \
golang-bin \
python \
python-pip \
gem \
npm \
make \
git \
unzip \
protobuf-compiler \
protobuf-devel && \
dnf clean all && \
rm -rf /var/cache/yum
RUN pip install virtualenv
RUN gem install grpc && gem install grpc-tools
RUN go get -u github.com/golang/protobuf/protoc-gen-go && \
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger && \
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
# Lock protoc-gen-go version to v1.1.0.
#
# NOTE:
# The latest uses new Invoke api which needs updates on:
# $ go get -u google.golang.org/grpc/...
# $ go get -u golang.org/x/sys/unix/...
# $ govendor remove google.golang.org/grpc/...
# $ govendor add +external google.golang.org/grpc/...
# $ govendor update +external golang.org/x/sys/unix/...
# Which may apply to project depending on OpenStorage.
#
WORKDIR /go/src/github.com/golang/protobuf
RUN git checkout v1.1.0 && go install github.com/golang/protobuf/protoc-gen-go
# Lock protoc-gen-swagger to v1.4.1
# The swagger output in the latest version seems to be incorrect
# See: https://github.com/grpc-ecosystem/grpc-gateway/issues/688
#
WORKDIR /go/src/github.com/grpc-ecosystem/grpc-gateway
RUN git checkout v1.4.1 && \
go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger && \
go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
# Download Dartlang
WORKDIR /usr/local
RUN curl -O https://storage.googleapis.com/dart-archive/channels/stable/release/2.2.0/sdk/dartsdk-linux-x64-release.zip && \
unzip dartsdk-linux-x64-release.zip && \
export PATH=$PATH:/usr/local/dart-sdk/bin && \
pub global activate protoc_plugin && \
echo 'export PATH=$PATH:/usr/local/dart-sdk/bin:$HOME/.pub-cache/bin' > /etc/profile.d/dart.sh
# Download protobuf files
WORKDIR /go/src/github.com
RUN mkdir protocolbuffers && \
cd protocolbuffers && \
git clone https://github.com/protocolbuffers/protobuf.git && \
cd protobuf && \
git checkout v3.6.1 && \
find . -type f | grep -v ".proto$" | xargs rm -f
# Finally, set working directory to the openstorage project
RUN mkdir -p /go/src/github.com/libopenstorage/openstorage
WORKDIR /go/src/github.com/libopenstorage/openstorage