-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
49 lines (36 loc) · 1.48 KB
/
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
41
42
43
44
45
46
47
48
49
FROM golang:1.13-stretch
MAINTAINER TRON-US <[email protected]>
# Dockerfile will build an image to run make build.
#ENV PATH="/go/bin:${PATH}"
ENV PROTOC_VERSION=3.10.0
ENV GOLANG_PROTOBUF_VERSION=1.3.2
ENV PROTOTOOL_VERSION=1.9.0
# Install patch
RUN apt-get update && apt-get install -y patch
RUN apt-get install -y unzip
RUN apt-get install -y postgresql-client redis-tools
# install standard c++ implementation of protocol buffers
RUN wget --quiet https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip
RUN unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d protoc3
RUN mv protoc3/bin/* /usr/local/bin/
RUN mv protoc3/include/* /usr/local/include
# install golang proto package
RUN GO111MODULE=on go get \
github.com/golang/protobuf/protoc-gen-go@v${GOLANG_PROTOBUF_VERSION} && \
mv /go/bin/protoc-gen-go* /usr/local/bin/
# install prototool
RUN wget --quiet https://github.com/uber/prototool/releases/download/v${PROTOTOOL_VERSION}/prototool-Linux-x86_64.tar.gz
RUN tar -xf prototool-Linux-x86_64.tar.gz
RUN mv prototool/bin/prototool /usr/local/bin/prototool
ENV SRC_DIR /go/src/github.com/tron-us/go-btfs-common
# Download packages first so they can be cached.
COPY go.mod go.sum $SRC_DIR/
RUN cd $SRC_DIR \
&& go mod download
COPY . $SRC_DIR
#WORKDIR /go-btfs-common
WORKDIR $SRC_DIR
# need to run trongogo before make build
RUN make trongogo build
# by default check protos dir for diffs
CMD make test_git_diff_protos