forked from decred/dcrd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-1.10
60 lines (49 loc) · 1.57 KB
/
Dockerfile-1.10
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
#decred-golang-builder-1.10
# This image may be called with the run_tests.sh script included in any of the
# supported go repos.
# ./run_tests.sh 1.10
FROM golang:1.10
LABEL description="Decred golang builder image"
LABEL version="1.0"
LABEL maintainer "dhill@mindcry.org"
ENV TERM linux
ENV USER build
# create user
RUN adduser --disabled-password --gecos '' $USER
# update base distro & install build tooling
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get install -qy rsync
# create directory for build artifacts, adjust user permissions
RUN mkdir /release && \
chown $USER /release
# create directory to get source from
RUN mkdir /src && \
chown $USER /src && \
mkdir -p /go/src/github.com/decred/dcrd && \
mkdir -p /go/src/github.com/decred/dcrwallet && \
mkdir -p /go/src/github.com/decred/dcrctl && \
mkdir -p /go/src/github.com/decred/dcrrpcclient && \
chown -R $USER /go/src
# switch user
USER $USER
ENV HOME /home/$USER
#Get deps
ENV DEP_TAG v0.4.1
ENV GLIDE_TAG v0.13.1
ENV GOMETALINTER_TAG v2.0.5
WORKDIR /go/src
RUN go get -v github.com/Masterminds/glide && \
cd /go/src/github.com/Masterminds/glide && \
git checkout $GLIDE_TAG && \
make build && \
mv glide `which glide` && \
go get -v github.com/alecthomas/gometalinter && \
cd /go/src/github.com/alecthomas/gometalinter && \
git checkout $GOMETALINTER_TAG && \
go install && \
gometalinter --install && \
go get -v github.com/golang/dep && \
cd /go/src/github.com/golang/dep && \
git checkout $DEP_TAG && \
go install -i