-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile.test
More file actions
66 lines (54 loc) · 2.5 KB
/
Dockerfile.test
File metadata and controls
66 lines (54 loc) · 2.5 KB
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
FROM ubuntu:18.04
ARG TARGETARCH
ARG GOLANG_VERSION="1.18.3"
SHELL ["/bin/bash", "-c"]
ENV GOPATH=/root/go
ENV GO111MODULE=on
ENV BASE_PATH=${GOPATH}/src/github.com/PositionExchange
ENV OPENSSL_DIR=/usr/lib/ssl
ENV MCL_DIR=${BASE_PATH}/mcl
ENV BLS_DIR=${BASE_PATH}/bls
ENV CGO_CFLAGS="-I${BLS_DIR}/include -I${MCL_DIR}/include -O0 -g"
ENV CGO_LDFLAGS="-L${BLS_DIR}/lib"
ENV LD_LIBRARY_PATH=${BLS_DIR}/lib:${MCL_DIR}/lib
ENV GIMME_GO_VERSION=${GOLANG_VERSION}
ENV PATH="/root/bin:${PATH}"
RUN apt update && apt upgrade -y && \
apt install libgmp-dev libssl-dev curl git \
psmisc dnsutils jq make gcc g++ bash tig tree sudo vim \
silversearcher-ag unzip emacs-nox nano bash-completion -y
RUN mkdir ~/bin && \
curl -sL -o ~/bin/gimme \
https://raw.githubusercontent.com/travis-ci/gimme/master/gimme && \
chmod +x ~/bin/gimme
RUN eval "$(~/bin/gimme ${GIMME_GO_VERSION})"
RUN touch /root/.bash_profile && \
gimme ${GIMME_GO_VERSION} >> /root/.bash_profile && \
echo "GIMME_GO_VERSION='${GIMME_GO_VERSION}'" >> /root/.bash_profile && \
echo "GO111MODULE='on'" >> /root/.bash_profile && \
echo ". ~/.bash_profile" >> /root/.profile && \
echo ". ~/.bash_profile" >> /root/.bashrc
ENV PATH="/root/.gimme/versions/go${GIMME_GO_VERSION}.linux.${TARGETARCH:-amd64}/bin:${GOPATH}/bin:${PATH}"
RUN cat /root/.bash_profile
RUN ls -lah /root/.gimme/versions/go${GIMME_GO_VERSION}.linux.${TARGETARCH:-amd64}/bin
RUN git clone https://github.com/PositionExchange/bls.git ${BASE_PATH}/bls
RUN git clone https://github.com/PositionExchange/mcl.git ${BASE_PATH}/mcl
RUN cd ${BASE_PATH}/bls && make -j8 BLS_SWAP_G=1
RUN curl -LO https://download.posichain.org/psc && chmod +x psc
RUN mv ./psc /root/bin/psc
RUN . ~/.bash_profile;
RUN go install golang.org/x/tools/cmd/goimports@latest
RUN go install golang.org/x/lint/golint@latest
RUN go install github.com/rogpeppe/godef@latest
RUN go install github.com/go-delve/delve/cmd/dlv@latest
RUN go install github.com/golang/mock/mockgen@latest
RUN go install github.com/stamblerre/gocode@latest
RUN go install honnef.co/go/tools/cmd/staticcheck@latest
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1
RUN go install github.com/fjl/gencodec@latest
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.41.1
WORKDIR ${BASE_PATH}/posichain
COPY . .
RUN ./scripts/install_build_tools.sh
CMD ["bash", "-c", "make go-get && make && ./scripts/travis_go_checker.sh"]