forked from alexei-led/pumba
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBuild.Dockerfile
46 lines (36 loc) · 1.23 KB
/
Build.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
FROM golang:1.7.3-alpine
MAINTAINER Alexei Ledenev <[email protected]>
# install Git apk
RUN apk --no-cache add git bash curl
# install glide package manager
ENV GLIDE_VERSION v0.12.3
RUN curl -Ls https://github.com/Masterminds/glide/releases/download/$GLIDE_VERSION/glide-$GLIDE_VERSION-linux-amd64.tar.gz | tar xz -C /tmp \
&& mv /tmp/linux-amd64/glide /usr/bin/
# gox - Go cross compile tool
# github-release - Github Release and upload artifacts
# goveralls - Go integration for Coveralls.io
# cover - Go code coverage tool
# go-junit-report - convert Go test into junit.xml format
RUN go get -v github.com/mitchellh/gox && \
go get -v github.com/aktau/github-release && \
go get -v github.com/mattn/goveralls && \
go get -v golang.org/x/tools/cmd/cover && \
go get -v github.com/jstemmer/go-junit-report
# prepare work directory
ENV PUMBADIR /go/src/github.com/gaia-adm/pumba
RUN mkdir -p $PUMBADIR
WORKDIR $PUMBADIR
# prepare dist directory and export is as volume
ENV DIST /.dist
RUN mkdir -p $DIST
VOLUME $DIST
# prepare directory for test results and coverage
ENV COVER /.cover
RUN mkdir -p $COVER
VOLUME $COVER
# install dependencies
COPY glide.* ./
RUN glide install
# add source files
COPY . .
CMD ["script/go_build.sh"]